0
创建一个自定义的请求这是我需要发送到wsdl
消息:如何使用节点皂
<?xml version="1.0" encoding="UTF-8" ?>
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:tem="http://tempuri.org/">
<soapenv:Header/>
<soapenv:Body>
<tem:ConsultarCreditos>
<tem:usuario>DEMO010233001</tem:usuario>
<tem:password>Pruebas1a$</tem:password>
</tem:ConsultarCreditos>
</soapenv:Body>
</soapenv:Envelope>
我有这样的代码:
const wsdlOptions = {
envelopeKey: "soapenv"
};
soap.createClient(URL, wsdlOptions, function(err, client) {
const args = {
_xml: '<tem:ConsultarCreditos><tem:usuario> DEMO010233001 </tem:usuario><tem:password>Pruebas1a$</tem:password></tem:ConsultarCreditos>',
}
client.ConsultarCreditos(args, function(err, result, raw, soapHeader) {
console.log('last request: ', client.lastRequest)
});
});
导致此:
<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
xmlns:tns="http://tempuri.org/"
xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract">
<soapenv:Body>
<tem:ConsultarCreditos>
<tem:usuario>DEMO010233001</tem:usuario>
<tem:password>Pruebas1a$</tem:password>
</tem:ConsultarCreditos>
</soapenv:Body>
</soapenv:Envelope>
我需要改变标签soapenv:Envelope
的属性,但我不知道该怎么做。
我只是需要这些属性:
> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
> xmlns:tem="http://tempuri.org/"
任何帮助将不胜感激