I want to log raw soap post requests if there are any errors , I am using JAX-WS. Any help will be appreciated.
Is there an easy way (aka: not using a proxy) to get access to the raw request/response XML for a webservice published with JAX-WS reference implementation (the one included in JDK 1.5 and better) only when exception occurs in response? I want to log raw SOAP reuest so that I can test it thorugh any webservice client at a later stage
I think that what you need is an handler, see: http://jax-ws.java.net/articles/handlers_introduction.html
With handler you can intercept web service call, and have access to all the SOAP message.
If you working with Jboss 6.1 and you want to print the logs for the JAX-WS generated classes request to the SOAP web service, open the file
/home/oracle/jboss-eap-6.1/bin/standalone.sh
note: please go where you have installed jbossYou will find something like this
Change it to the one shown below
Also make sure you enable debug
This worked for me:
The first thing you might want to try is using one, or both, of the following system properties:
Client:
Server:
Just thought I would mention this:
The question when to use the property name with the
internal
in it and when not ?If you read the Metro Guide it will tell you to use:
on client:
on server:
However: It seems to me that when JAX-WS RI library got included as standard with the JDK (this was with Java 6) then Sun had to rename the property name to include 'internal'. So if you are using JAX-WS RI as it comes bundled with the JDK, then you must be sure to add the
internal
to the property name. Otherwise it will not work. In other words you need to use:on client:
on server:
On the other hand if you are using a standalone version of JAX-WS RI (or of Metro as a whole) then I would guess you should use the property name without the
internal
.I'll be glad if someone has inside knowledge on this and can say if this is true or not.
Use
com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.dump=true
and
com.sun.xml.internal.ws.transport.http.HttpAdapter.dump=true
instead (note the "internal" in the package name), this did the trick for me.
Cheers, Torsten