DHL soap服务客户端返回服务器超时错误。我正在使用SOAP pakcage创建客户端。添加了完整的代码。我已经测试了凭据,并且它们工作正常。您可以检查(https://cig.dhl.de/services/sandbox/soap/)以获得soap示例
var soap = require('soap');
var apiWSDL = 'http://cig.dhl.de/services/sandbox/soap';
var auth = "Basic " + new Buffer.from("*****" + ":" + "*****").toString("base64");
function getDetails() {
var p = new Promise(function(resolve, reject) {
soap.createClient(apiWSDL, { wsdl_headers: { Authorization: auth } }, function (err, client) {
if(err) throw new Error(err);
var args = {
userHash:'',
orderBy:'',
pageSize:'2000',
pageNumber:'1',
userName:''
}
client.createShipmentOrder(args, function(err, result) {
if(err) reject(err);
if(!result) {
console.log('No result...')
}
var sets = result.getSetsResult.sets;
console.log('i found '+sets.length+' results');
if(sets.length) {
resolve(set);
} else {
resolve(set);
}
}
);
});
});
return p;
}
exports.getRandomSet = getDetails;
{ Error: connect ETIMEDOUT 149.239.125.123:80
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1113:14)
errno: 'ETIMEDOUT',
code: 'ETIMEDOUT',
syscall: 'connect',
address: '149.239.125.123',
port: 80 }