如何配置node-soap请求主体的根元素?

时间:2017-08-11 13:54:45

标签: javascript soap wsdl soap-client node-soap

我正在尝试使用 node-soap 包调用SOAP方法。 我的服务的WSDL是:

<wsdl:definitions name="PublicoService" targetNamespace="http://tempuri.org/">
    <wsdl:import namespace="" location="http://10.10.0.45:56777/Services/PublicoService.svc?wsdl=wsdl0"/>
    <wsdl:types/>
    <wsdl:binding name="CustomBinding_PublicoService" type="PublicoService">
        <soap:binding transport="http://schemas.xmlsoap.org/soap/http"/>
        <wsdl:operation name="GetAllDepartamento">
            <soap:operation soapAction="urn:PublicoService/GetAllDepartamento" style="document"/>
            <wsdl:input>
                <soap:body use="literal"/>
            </wsdl:input>
            <wsdl:output>
                <soap:body use="literal"/>
            </wsdl:output>
        </wsdl:operation>
        .....

我的客户端代码:

soap.createClient(url, {}, function(err, client) {
    client.GetAllDepartamento({}, function(err, result, raw, soapHeader) {
        console.log(result);
    });
});

请求已经完成,但我得到了信封正文

<soap:Body>
    <PublicoService_GetAllDepartamento_InputMessage></PublicoService_GetAllDepartamento_InputMessage>
</soap:Body>

导致错误,因为<PublicoService_GetAllDepartamento_InputMessage>应为<GetAllDepartamento>

我已经尝试但无法更改该标记,它是自动创建的。 有什么帮助吗?

0 个答案:

没有答案
相关问题