0

所以我正在尝试执行以下操作

soapClient.getDeptUser({
        UserName : "temp",
        UserPassword : "temp"
     },
        userNumber : "xxxxxx"
    }}, (err,result) => {
        if(err){
            console.log(soapClient.lastRequest);
        }else{
            console.log(result);
        }
    }); 

但我不断从 Web 服务收到错误:无法从请求中识别任何 WSDL 操作。

我的最后一个请求如下所示:

<soap:Body Id="_0">
  <getDeptUserRequest>
    <User>
      <UserName>temp</UserName>
      <UserPassword>temp</UserPassword
    </User>
      <userNumber>xxxxx</userNumber>
  </getDeptUserRequest>
</soap:Body>

我认为问题在于没有名为 getDeptUserRequest 的方法,但我试图调用 getDeptUser 不确定如何防止将单词 Request 附加到方法名称上。

WSDL

<?xml version="1.0" encoding="UTF-8"?>
  <wsdl:definitions targetNamespace="http://webservices.cxfdept.fbem"    
    xmlns:tns1="http://pojo.webservices.cxf.fbem"
    xmlns:schema="http://methods.webservices.cxf.fbem" 
    xmlns:tns="http://webservices.cxfdept.fbem"
      xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" 
      xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
      xmlns:soap11="http://schemas.xmlsoap.org/soap/envelope/" 
      xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" 
      xmlns:soapenc11="http://schemas.xmlsoap.org/soap/encoding/" 
      xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
    <!-- ****************************************************** -->
    <!-- ***  import complex types definitions for this XSD ***-->
    <!-- ****************************************************** -->
    <wsdl:import namespace="http://methods.webservices.cxf.fbem" location="WsFBEMDept_methods_01.xsd"></wsdl:import>
    <!-- *************************************************** -->
    <!-- *******    Set messages ****************************-->
    <!-- *************************************************** -->
    <!-- getDeptUserRequest -->
    <wsdl:message name="getDeptUserRequest">
      <wsdl:part name="parameters" element="schema:getDeptUser"/>
    </wsdl:message>  
    <wsdl:message name="getDeptUserResponse">
      <wsdl:part name="parameters" element="schema:getDeptUserResponse"/>
    </wsdl:message>
    <!-- ****************************************************** -->
    <!-- *******   Set portTypes                            *** -->
    <!-- ****************************************************** -->
    <wsdl:portType name="WsFBEMDeptServiceV1001PortType">
      <wsdl:operation name="getDeptUser">
        <wsdl:input name="getDeptUserRequest" message="tns:getDeptUserRequest"/>
        <wsdl:output name="getDeptUserResponse" message="tns:getDeptUserResponse"/>
      </wsdl:operation>
    <!-- ****************************************************** -->
    <!-- ****   Set Bindings                                *** -->
    <!-- ****************************************************** -->
      <wsdl:binding name="WsFBEMDeptServiceV1001HttpBinding" type="tns:WsFBEMDeptServiceV1001PortType">
      <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
        <!-- getDeptUser -->
        <wsdl:operation name="getDeptUser">
        <wsdlsoap:operation soapAction=""/>
          <wsdl:input name="getDeptUserRequest">
          <wsdlsoap:body use="literal"/>
        </wsdl:input>
          <wsdl:output name="getDeptUserResponse">
          <wsdlsoap:body use="literal"/>
        </wsdl:output>
      </wsdl:operation> 
    <!-- ****************************************************** -->
    <!-- ***     Set Service                                *** -->
    <!-- ****************************************************** -->
      <wsdl:service name="WsFBEMDeptServiceV1001">
        <wsdl:port name="WsFBEMDeptServiceV1001HttpPort" binding="tns:WsFBEMDeptServiceV1001HttpBinding">
          <wsdlsoap:address location="http://127.0.0.1:8080/fbem_cxfDept/services/WsFBEMDeptServiceV1001"/>
      </wsdl:port>
    </wsdl:service>
  </wsdl:definitions>
4

0 回答 0