views:

1783

answers:

6

I wonder if there is some neat way to intercept xml request send during java webservice method invocation and xml given in response? I don't want to print those xmls to standard output but to "catch" them in some string.

+4  A: 

Yes, normally you use a soap proxy like soapUI. Simply point your webservice client at the proxy and the proxy at the real service.

krosenvold
A: 

Yes, you can use a packet sniffer and see what's in your traffic.

I have never got that far.

What I have used is a very simple home made protocol, that reads all the input, print it and re-send all the info.

OscarRyz
A: 

If you can deploy servlets on the server providing the web service you might consider writing and deploying a simple Filter. You can use this to log both the inbound and the outbound traffic.

Jeroen van Bergen
A: 

Fiddler or SoapUI will let you see and even CHANGE the request/response in route.

Chris Nava
A: 

I like Membrane Monitor because it has a XML formatter and syntax highlighting for SOAP messages. You can save the captured messages or you can write an interceptor and "catch" the SOAP body as a InputStream or String.

baranco