views:

683

answers:

1

This is probably an easy question for anyone with any moderate expertise with web services using Apache Axis.

I have a web service client that was generated by wsdl2java in Axis 1.4. I am writing unit tests that need to access the actual SOAP message itself, and do a comparison to the client side java classes which are generated by Axis. (don't ask)

How can I retrieve the actual SOAP message from a response from the service?

From what I can gather from searching around is that I have to get the MessageContext. I have tried something along these lines...

MessageContext mc = MessageContext.getCurrentContext(); String message = mc.getCurrentMessage().getSOAPPartAsString();

But mc is null in this case....

Any help is appreciated!

A: 

This is how it's done.

http://users.skynet.be/pascalbotte/rcx-ws-doc/jaxrpchandler.htm