node-soap将“请求”附加到wsdl方法

时间:2017-05-22 19:03:04

标签: node.js web-services soap wsdl node-soap

所以我正在尝试执行以下

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>

0 个答案:

没有答案