我正在使用这个库node js https://github.com/vpulim/node-soap 。当我尝试向客户端提供参数时,如果参数是 DateAdvance: '"会出现以下错误:
Error: soap: Client: Server was unable to read request. ---> There is an error in XML document (1, 467). ---> Input string was not in a correct format
这是代码的一部分
var soap = require ('soap');
var url = 'https://elstestserver.endicia.com/LabelService/EwsLabelService.asmx?wsdl';
var args = {LabelRequest: {DateAdvance: ""}};
soap.createClient (url, function (err, client) {
client.MyFunction (args, function (err, result) {
console.log (result);
});
});
仅包含“DateAdvance”一词。
谢谢。
最佳答案
我是个白痴,在 SOAP 服务的文档中说该字段是整数,我需要将其放在不带双引号的位置。抱歉给您带来麻烦。
var args = {LabelRequest: {DateAdvance: 0}};
关于node.js - Node js SOAP 库与 DateAdvance 一词相关的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34445032/