Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Axis2: Incoming SOAP messages: logging and validation

 
Roby Kappa
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I need to log the content of incoming soap messages in Axis2, BEFORE any kind of elaboration from Axis2(for example, I need to log the message also if it isn't well-formed, or the Security Header is invalid). Is there a way to simply do this, for example enabling debug log for a particular Axis2 class/package? I've tried to enable debug for the whole org.apache package and I'm quite surprised that, in tons of log, the SOAP message is never printed!

Also, I need to enable XSD validation (in particular, validation of soap-body content based on WSDL) for the incoming messages, that it seems disabled by default in Axis2. Any idea?

Thanks.
 
shivendra tripathi
Ranch Hand
Posts: 263
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use handlers to log as well as validate soap messages.
http://shivendra-tripathi.blogspot.com/search/label/AXIS2%20Handler
 
Roby Kappa
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
shivendra tripathi wrote:You can use handlers to log as well as validate soap messages.
http://shivendra-tripathi.blogspot.com/search/label/AXIS2%20Handler


It is a possibile solution, but I hope there is a more simple solution that doesn't imply writing a custom module. It is quite strange that logging of SOAP messages and schema validation are not embedded in a product that was designed to work with webservices and XML/SOAP!

By the way, custom handlers work at "MessageContext" level, and in this object, the SOAP message was already parsed and available as SOAPEnvelope Axiom object. In this case a non-well formed XML cannot be read and logged. I think the logging should be done at transport (http request) level.

In the second case, validating the XML in an handler is difficult because I don't think that the WSDL is referenced by the messageContext...

Thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic