Is it possible to get the parameters passed through a web-service call by using a handler on the client side? I’m trying to log the parameters i’ve sent to the web-service, everytime i do so.
In this chase, using a jax-ws handler that i’ve assigned to the web-service. This is a simple and common example of the handler look and methods.
public class RafaSOAPHandler implements SOAPHandler<SOAPMessageContext> {
@Override
public boolean handleMessage(SOAPMessageContext context) {
System.out.println("Client : handleMessage()......");
// TODO: GET METHOD PARAMETERS HERE.
return true;
}
@Override
public boolean handleFault(SOAPMessageContext context) {
System.out.println("Client : handleFault()......");
return true;
}
@Override
public void close(MessageContext context) {
System.out.println("Client : close()......");
}
@Override
public Set<QName> getHeaders() {
System.out.println("Client : getHeaders()......");
return null;
}
}
The answer is simple: Yes it is possible. You can extract the soap message from
SOAPMessageContextlike this:And as long as you have soap envelope you get any parameter from your
SOAPmessage.