Axis2 SOAP message logging

less than 1 minute read

From time to time I want to read the messages that are send from Axis to the endpoint.

The solution is quite simple if you already use a logging framework for your application which you definitely should…

Set some properties in your log4j.properties file and you’re done:

log4j.logger.org.apache.axis2.enterprise=FATAL
log4j.logger.de.hunsicker.jalopy.io=FATAL
log4j.logger.httpclient.wire.header=debug
log4j.logger.httpclient.wire=debug 
log4j.logger.org.apache.commons.httpclient=debug

or use the command line to set some properties in case you haven’t used a logger before

-Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.SimpleLog 
-Dorg.apache.commons.logging.simplelog.showdatetime=true 
-Dorg.apache.commons.logging.simplelog.log.httpclient.wire=debug 
-Dorg.apache.commons.logging.simplelog.log.org.apache.commons.httpclient=debug

Noteworthy that you might disable the gzip compression unless you read gzip-streams fluently.

Options options = serviceStub.getService()._getServiceClient().getOptions(); options.setProperty(HTTPConstants.MC_ACCEPT_GZIP, Boolean.FALSE); options.setProperty(HTTPConstants.MC_GZIP_REQUEST, Boolean.FALSE);