3

My Webservice invocation from the client was working fine, until I added SOAP headers for the authentication and now the client is getting the following error

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

The following is WSDL which includes the changes recently done for adding authentication information in the SOAP header, is there anything obvious I missed here?

<?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>
4

1 回答 1

3

找到了上述问题的答案,问题是 SOAP 标头的新消息部分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" />

于 2013-06-09T03:59:25.737 回答