gpt4 book ai didi

web-services - Web 服务调用返回 faultString "Cannot find dispatch method for namespace/soapAction"

转载 作者:行者123 更新时间:2023-12-02 00:08:15 35 4
gpt4 key购买 nike

我从客户端调用的 Web 服务工作正常,直到我为身份验证添加了 SOAP header ,现在客户端收到以下错误

 <faultcode>S:Client</faultcode><faultstring>Cannot find dispatch method
for {http://com.analysis.num/}doNumAnalysis</faultstring>

以下是 WSDL,其中包括最近为在 SOAP header 中添加身份验证信息所做的更改,我在这里是否遗漏了任何明显的内容?

<?xml version='1.0' encoding='UTF-8'?>
<definitions xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
xmlns:wsp="http://www.w3.org/ns/ws-policy" xmlns:wsp1_2="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://com.analysis.num/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://com.analysis.num/" name="NumericAnalysisService">
<types>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.0"
targetNamespace="http://com.analysis.num/">
<xs:element name="doNumAnalysis" type="tns:doNumAnalysis" />
<xs:element name="doNumAnalysisResponse" type="tns:doNumAnalysisResponse" />
<xs:complexType name="doNumAnalysis">
<xs:sequence>
<xs:element name="numRequest" type="tns:numRequest" minOccurs="0" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="numRequest">
<xs:sequence>
<xs:element name="Analysis_Type" type="xs:string" />
<xs:element name="Analysis_Id" type="xs:string" />
<xs:element name="Customer_Id" type="xs:string" />
<xs:element name="Source_Request_Id" type="xs:string" />
<xs:element name="Destination_Request_Id" type="xs:string" />
<xs:element name="Target_Customer_Id" minOccurs="0" type="xs:string" />
<xs:element name="AnalysisFile" minOccurs="0" type="xs:string" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="doNumAnalysisResponse">
<xs:sequence />
</xs:complexType>
<xs:element name="AuthenticationInfo" type="tns:AuthenticationInfo"/>
<xs:complexType name="AuthenticationInfo">
<xs:sequence>
<xs:element name="userName" type="xsd:string"/>
<xs:element name="password" type="xsd:string"/>
<xs:element minOccurs="0" name="authentication" type="xsd:string"/>
<xs:element minOccurs="0" name="locale" type="xsd:string"/>
<xs:element minOccurs="0" name="timeZone" type="xsd:string"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
</types>
<message name="doNumAnalysis">
<part name="parameters" element="tns:doNumAnalysis" />
</message>
<message name="doNumAnalysisResponse">
<part name="parameters" element="tns:doNumAnalysisResponse" />
</message>
<message name="ARAuthenticate">
<part element="tns:AuthenticationInfo" name="parameters">
</part>
</message>
<portType name="NumericAnalysisService">
<operation name="doNumAnalysis">
<input wsam:Action="http://com.analysis.num/NumericAnalysisService/doNumAnalysisRequest" message="tns:doNumAnalysis" />
<output wsam:Action="http://com.analysis.num/NumericAnalysisService/doNumAnalysisResponse" message="tns:doNumAnalysisResponse" />
</operation>
</portType>
<binding name="NumericAnalysisServicePortBinding" type="tns:NumericAnalysisService">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
<operation name="doNumAnalysis">
<soap:operation soapAction="" />
<input>
<soap:header message="tns:ARAuthenticate" part="parameters" use="literal">
</soap:header>
<soap:body use="literal" />
</input>
<output>
<soap:body use="literal" />
</output>
</operation>
</binding>
<service name="NumericAnalysisService">
<port name="NumericAnalysisServicePort" binding="tns:NumericAnalysisServicePortBinding">
<soap:address location="https://testserver/bmcems/NumericAnalysisService" />
</port>
</service>
</definitions>

最佳答案

找到上述问题的答案,问题是 SOAP header 的新消息部分使用名称 parameters已经在使用中,将其重命名为 authParameters解决了这个问题。

上述 WSDL 中的以下更改修复了此问题:

<message name="ARAuthenticate">
<part element="tns:AuthenticationInfo" name="
参数 authParameters">

...

<soap:header message="tns:ARAuthenticate" part=" 参数 authParameters" use="literal">
</soap:header>
<soap:body use="literal" />

关于web-services - Web 服务调用返回 faultString "Cannot find dispatch method for namespace/soapAction",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16996499/

35 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com