I\'m trying to write a client for russian post to get track. It uses SOAP WSDL. I\'m to get at least client object.
\'use strict\'
let soap=require(\'soap\
Solved. Workaround of issue. First instead of their .wsdl file I use modified original wsdl file and store it locally.
workaround of xml file Fixed it by adding into schema targetnNamespace parameter.
Original wsdl code part
now to use our wsdl file:
var SoapClient = require('soap');
var options = {
'trace': 1,
"overrideRootElement": {
"namespace": "myns",
"xmlnsAttributes": [{
"name": "xmlns:ns2",
"value": "http://russianpost.org/operationhistory"
}]
},
forceSoap12Headers: true,
connection: 'keep-alive',
'soap_version': 2
};
SoapClient.createClient('./local_wsdl.xml', options, function (err, client) {
client.getOperationHistory(
{
'ns1:OperationHistoryRequest': {
'ns1:Barcode': trackValue,
'ns1:MessageType': 0,
'ns1:Language': 'RUS',
},
'ns1:AuthorizationHeader': {
'ns1:login': login,
'ns1:password': password,
},
},
(err, result) => {
if (err) {
console.log(err);
return;
}
console.log(result.OperationHistoryData);
}
);
}