如何使用 AXis 1.4 创建 java 客户端以使用 wsHttpBinding 消费 WCF 服务
我使用 axis 1.4 创建了一个 java 客户端来使用 WCF 服务。如果我使用 basicHttpBinding 则一切正常,但如果我使用 wsHttpBinding 则出现以下错误:-
Did not understand "MustUnderstand" header(s):{http://www.w3.org/2005/08/addressing}Action
AxisFault
faultCode: {http://www.w3.org/2003/05/soap-envelope}MustUnderstand
faultSubcode:
faultString: Did not understand "MustUnderstand" header(s):{http://www.w3.org/2005/08/addressing}Action
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}stackTrace:
at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:96)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
at org.apache.axis.client.Call.invoke(Call.java:2767)
at org.apache.axis.client.Call.invoke(Call.java:2443)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at org.tempuri.WSHttpBinding_IService1Stub.getData(WSHttpBinding_IService1Stub.java:171)
at Mytes.main(Mytes.java:14)
{http://xml.apache.org/axis/}hostname:2207A-H7-SITA
Did not understand "MustUnderstand" header(s):{http://www.w3.org/2005/08/addressing}Action
at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:96)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
at org.apache.axis.client.Call.invoke(Call.java:2767)
at org.apache.axis.client.Call.invoke(Call.java:2443)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at org.tempuri.WSHttpBinding_IService1Stub.getData(WSHttpBinding_IService1Stub.java:171)
at Mytes.main(Mytes.java:14)
请让我知道如何解决此错误。谢谢。
I have created a java client for consuming WCF service using axis 1.4. If I use basicHttpBinding than everything works fine, but if I use wsHttpBinding than I am getting following error:-
Did not understand "MustUnderstand" header(s):{http://www.w3.org/2005/08/addressing}Action
AxisFault
faultCode: {http://www.w3.org/2003/05/soap-envelope}MustUnderstand
faultSubcode:
faultString: Did not understand "MustUnderstand" header(s):{http://www.w3.org/2005/08/addressing}Action
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}stackTrace:
at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:96)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
at org.apache.axis.client.Call.invoke(Call.java:2767)
at org.apache.axis.client.Call.invoke(Call.java:2443)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at org.tempuri.WSHttpBinding_IService1Stub.getData(WSHttpBinding_IService1Stub.java:171)
at Mytes.main(Mytes.java:14)
{http://xml.apache.org/axis/}hostname:2207A-H7-SITA
Did not understand "MustUnderstand" header(s):{http://www.w3.org/2005/08/addressing}Action
at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:96)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
at org.apache.axis.client.Call.invoke(Call.java:2767)
at org.apache.axis.client.Call.invoke(Call.java:2443)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at org.tempuri.WSHttpBinding_IService1Stub.getData(WSHttpBinding_IService1Stub.java:171)
at Mytes.main(Mytes.java:14)
Pls let me know how can I resolve this error. Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
当您使用 Axis 为 WCF 服务生成代理时,它会生成自动设置
http://www.w3.org/2005/08/addressing
MustUnderstand 标头的存根code>下面的代码将 MustUnderstand 标志重置回 false。对于正在调用的方法。我今天遇到了类似的问题,并且能够使用此处发布的代码解决
我发现 这篇关于 MustUnderstand 的文章非常有帮助。
When you use Axis to generate proxy for a WCF service, it generates the stub that automatically sets the
MustUnderstand
header forhttp://www.w3.org/2005/08/addressing
The code below resets the MustUnderstand flag back to false. for the method being invoked. I had a similar issue today and was able to resolve using the code that's posted here
I found the this post on MustUnderstand veru helpful.
BasicHttpBinding 或 webHttpBinidng(REST 服务)是与非 Microsoft 技术交互的唯一选项。
BasicHttpBinding 是唯一支持 Basic Profile 1.1 互操作性的绑定。
请浏览以下链接,看看它们是否可以帮助您了解基本的出价和 ws 出价。
http://www.devproconnections。 com/article/net-framework2/choosing-the-right-web-service-binding.aspx
链接
BasicHttpBinding or webHttpBinidng (REST services) are the only option to interact with non-microsoft technologies.
BasicHttpBinding is only binding which supports the Basic Profile 1.1 for interoperability.
Please go through below links and see if they can help you out to understand basic and ws bidning.
http://www.devproconnections.com/article/net-framework2/choosing-the-right-web-service-binding.aspx
Link