axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kasi, Anand" <Anand.K...@sabre-holdings.com>
Subject RE: printing out SOAP messages to axis.log
Date Wed, 16 Nov 2005 01:09:55 GMT
There are different ways to do this. One way is to create your own handler for logging transactions.
Extend the BasicHandler class in Axis. You can get access to the MessageContext object inside
the invoke method. See the following code snippet.
 
public void invoke(MessageContext msg) throws AxisFault
 {
      //Log the request
  Message request = msg.getRequestMessage();
  logger.info("SOAP Request  :"+ request.getSOAPPartAsString());
  
  //Log the response
  Message response = msg.getResponseMessage();
  logger.info("SOAP Response  :" + response.getSOAPPartAsString());
 }
 
Anand

________________________________

From: Nikita Tovstoles [mailto:Nikita.Tovstoles@Sun.COM]
Sent: Tue 11/15/2005 6:53 PM
To: axis-user@ws.apache.org
Subject: printing out SOAP messages to axis.log



Hi,


I'd like to print out raw incoming and outgoing SOAP messages. Adding
the following to log4j.props file did produce some log output, but not
the SOAP xml. What am I missing?

log4j.rootLogger=warn, stdout, A1
# show DEBUG for SOAPPart method
log4j.logger.org.apache.axis.SOAPPart=DEBUG
# A1 is set to be a ConsoleAppender.
# log4j.appender.A1=org.apache.log4j.ConsoleAppender
log4j.appender.A1=org.apache.log4j.FileAppender
log4j.appender.A1.File=/tmp/axis.log
# A1 uses PatternLayout.
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n


thanks
-nikita



Mime
View raw message