This is a programming response. Go go super OpenSource!
You can catch and print the bytes as the go to / come
off the transport API's.
If you are using HTTP as a transport, add the following
lines of code to the org.apache.soap.util.net.HTTPUtils
class :
Around line 239, after the
bOutStream.flush();
outStream.flush();
add in
System.out.println("");
System.out.println(" [ RAW HTTP REQUEST " + (new
java.util.Date()).toString() + " ] ");
System.out.println(headerbuf.toString());
request.writeTo( System.out );
Then, near line 357, after the
} catch (MessagingException me) {
throw new IllegalArgumentException("Error parsing
response: " + me);
}
add in
// Write out the http response to System.out
System.out.println("");
System.out.println(" [ RAW HTTP RESPONSE " + (new
java.util.Date()).toString() + " ] ");
System.out.println( new String( bytes ) );
Compile the class.
Copy the soap.jar file that comes with Apache SOAP v2.2
to a convienant directory, call it Bob.
Open a command prompt, change to that directory.
Type "jar xvf". This will blow out the jar file into a
tree of classes. Replace the HTTPUtils class with your
new one. Delete the copy of soap.jar
Go back to Bob. Delete the copy of soap.jar
Type "jar cvf soap.jar *"
You now have a new soap.jar that will print the raw
request / responses in their entirety to System.out
I hope this helps. I found it quite useful in debugging.
Ian
dovle wrote:
>
> I have never used TcpTunnelGui , but instead the UtilSnoop ( a simple java
> app that does almost the same thing as TcpTunnelGui ) . This GUI app can
> catch requests and responses and has an option to save them in files .
> You should try it ... If you have time ,
> dovle
>
> > Hi,
> >
> > Is there any way to print my soap request/responses to a file? I've used
> > TcpTunnelGui, but I have deployed my soap service in application server,
> > where I want to save the soap request/responses to a file.
> > Your help/advises greatly appreciated.
> >
> > Thanks & Regards,
> > Sekhar Nadella
--
Software Engineer
EzGov
work : (404) 836-7957
To err is human.
To System.err is machine.