I found a very nifty feature of GlassFish. You can configure GlassFish to log the contents of a SOAP request and response. I have found this to be very useful during development/debugging of Web Services. There is a different configuration parameter depending on which version of GlassFish you are using.

GlassFish 3

This configuration is very simple. Edit your domain config file, in my case, domains/domain1/config/domain.xml. Add the following entry in the java-config section:

[xml]
<!– Setup SOAP messaging logging –>
<jvm-options>-Dcom.sun.metro.soap.dump=true</jvm-options>
[/xml]

GlassFish 2

A similar config is available for GlassFish 2. Edit your domain config file, in my case, domains/domain1/config/domain.xml. Add the following entry in the java-config section:

[xml]
<!– Setup SOAP messaging logging –>
<jvm-options>-Dcom.sun.xml.ws.assembler.server=true</jvm-options>
[/xml]

I hope you find this tip useful 🙂