如何在使用Axis 1.4 wsdl2java生成的客户端时获取SOAP消息 [英] How to get SOAP message while using a Axis 1.4 wsdl2java-generated client
问题描述
对于任何熟悉使用Apache Axis的Web服务的人来说,这可能是一个简单的问题.
This is probably an easy question for anyone with any moderate expertise with web services using Apache Axis.
我有一个由wsdl2java在Axis 1.4中生成的Web服务客户端.我正在编写需要访问实际SOAP消息本身的单元测试,并与Axis生成的客户端Java类进行比较. (不要问)
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)
如何从服务响应中检索实际的SOAP消息?
How can I retrieve the actual SOAP message from a response from the service?
从搜索中可以发现的是,我必须获取MessageContext. 我已经尝试了一些类似的方法...
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(); 字符串消息= mc.getCurrentMessage().getSOAPPartAsString();
MessageContext mc = MessageContext.getCurrentContext(); String message = mc.getCurrentMessage().getSOAPPartAsString();
但是在这种情况下mc为空....
But mc is null in this case....
感谢您的帮助!
推荐答案
这是完成的过程.
http://users.skynet.be/pascalbotte/rcx- ws-doc/jaxrpchandler.htm
这篇关于如何在使用Axis 1.4 wsdl2java生成的客户端时获取SOAP消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!