File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Services and the fly likes Axis2: Incoming SOAP messages: logging and validation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Axis2: Incoming SOAP messages: logging and validation " Watch "Axis2: Incoming SOAP messages: logging and validation " New topic
Author

Axis2: Incoming SOAP messages: logging and validation

Roby Kappa
Greenhorn

Joined: Oct 28, 2007
Posts: 19
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

Joined: Aug 26, 2008
Posts: 263
You can use handlers to log as well as validate soap messages.
http://shivendra-tripathi.blogspot.com/search/label/AXIS2%20Handler


SCJP 1.5(97%) My Blog
Roby Kappa
Greenhorn

Joined: Oct 28, 2007
Posts: 19
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
 
wood burning stoves
 
subject: Axis2: Incoming SOAP messages: logging and validation
 
Similar Threads
Log4j: How to get entire message
WS-Addressing
SOAP Proxy - A web service tool that validate SOAP messages
Axis2 won't respond to empty SOAP body
Axis stubs not validating properly