4

我正在尝试使用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>.

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

4

0 回答 0