views:

232

answers:

3

I have created a Java Webservice(first .WSDL file,then wsdl2Java)using Axis2 stack sucessfully.If I'm using Axis2 stack,it'll creates all the Java beans stuff.

I have written a Webservice Client using Stubs generated from the WSDL in pure Java by creating Request Object ( in Java) and in the Response I got java object.

But my requirement is that, I need to get the .XML format for the both.

Please let me know how can I capture actual SoapRequest.xml file and the SoapResponse.xml file.

A: 

Use Charles or WireShark to intercept http traffic.

zdmytriv
A: 

I am not sure how to do in Java. But check if SOAP tracer by MS can be used ? It intercepts the SOAP request and response and show in its editor.

aJ
A: 

Axis comes with a utility called tcpmon, which is designed for this. It acts as a proxy, and shows the request/response pairs as you issue/receive them. Just run:

java org.apache.axis.utils.tcpmon [listenPort targetHost targetPort]

and redirect the SOAP requests via this. You'll get a UI showing each request and the corresponding response.

Brian Agnew