Thursday, March 31, 2011

How to view the Actual SOAP Request and Response XML being transferred behind the screen in AXIS

From the MessageContext instance, we can get the SOAP request and the SOAP response.

In the generated Stub class(for Apache AXIS), go to the web method and we can use the instance org.apache.axis.client.Call _call = createCall(); to print the actual SOAP request and response.

System.out.println(" Request is ====>>> "+_call.getMessageContext().getRequestMessage().getSOAPPartAsString());
System.out.println(" Response is ====>>> "+_call.getMessageContext().getResponseMessage().getSOAPPartAsString());

No comments:

Post a Comment