【问题标题】:The SOAP action specified on the message, '', does not match the HTTP SOAP Action, 'https://cs.com/ICC2/GetServiceProduct'对消息“”指定的 SOAP 操作与 HTTP SOAP 操作“https://cs.com/ICC2/GetServiceProduct”不匹配
【发布时间】:2015-02-01 07:22:17
【问题描述】:

我正在尝试在我的 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]"

【问题讨论】:

    标签: java web-services soap axis2


    【解决方案1】:

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

    使用以下 sn-p 在您的服务客户端上使用寻址模块

    ServiceClient serviceClient = stub._getServiceClient(); //stub here refers to your generated connection stub
    serviceClient.engageModule("addressing"); //throws an AxisFault if there's a problem
    

    【讨论】:

    • 我尝试使用寻址模块,但它给了我错误 - 无法使用模块:寻址
    • 您缺少一些依赖项@sairam。有关后续步骤,请参阅this question
    【解决方案2】:

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

    【讨论】:

    • 客户在多个合作伙伴(包括我们)之间共享此 WSDL,但他们尚未收到任何投诉。所以很可能问题可能不在于命名空间,因为它可能会破坏每个人。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-01-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多