在消息上指定的SOAP操作''与HTTP SOAP Action不匹配,'https://cs.com/ICC2/GetServiceProduct'

时间:2015-02-01 07:22:18

标签: java web-services soap axis2

我正在尝试在我的java应用程序中使用客户端提供的Web服务。我使用axis2-1.4.1从给定的WSDL生成存根类。但是当我试图从存根类调用任何方法时,我得到以下错误。我是网络服务的新手,并且在过去2天内陷入了这个问题:-(任何帮助都会非常感激。

</s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.w3.org/2005/08/addressing"><s:Header><a:Action s:mustUnderstand="1">http://www.w3.org/2005/08/addressing/fault</a:Action></s:Header><s:Body><s:Fault><s:Code><s:Value>s:Sender</s:Value><s:Subcode><s:Value>a:ActionMismatch</s:Value></s:Subcode></s:Code><s:Reason><s:Text xml:lang="en-US">**The SOAP action specified on the message, '', does not match the HTTP SOAP Action**, 'https://consumerconnectws.tui.transunion.com/ICC2/GetServiceProduct'. </s:Text></s:Reason><s:Detail><a:ProblemHeaderQName>a:Action</a:ProblemHeaderQName></s:Detail></s:Fault></s:Body></s:Envelope>"

Must Understand check failed for header http://www.w3.org/2005/08/addressing : Action
org.apache.axis2.AxisFault: Must Understand check failed for header http://www.w3.org/2005/08/addressing : Action
at org.apache.axis2.engine.AxisEngine.checkMustUnderstand(AxisEngine.java:102)

当我在日志中检查请求标头时,我注意到SOAP操作传递的内容类型标头如下所示。我用版本axis2-1.5.6尝试了相同的东西,但没有运气。

"Content-Type: application/soap+xml; charset=UTF-8; action="https://consumerconnectws.tui.transunion.com/ICC2/GetServiceProduct"[\r][\n]"

2 个答案:

答案 0 :(得分:1)

错误消息表明Web服务的WS-Addressing要求您的服务调用未满足。 WS-Addressing规范规定了一些允许Web服务以与传输机制无关的方式运行的属性。

使用以下代码段

在服务客户端上使用寻址模块
ServiceClient serviceClient = stub._getServiceClient(); //stub here refers to your generated connection stub
serviceClient.engageModule("addressing"); //throws an AxisFault if there's a problem

答案 1 :(得分:0)

似乎Web服务无法理解所调用的操作 https://consumerconnectws.tui.transunion.com/ICC2/GetServiceProduct 尝试下载服务的WSDL并检查其中使用的名称空间是否与用于生成客户端的WSDL中的名称空间相同。