简体   繁体   English

节点肥皂中的数组

[英]Arrays in node-soap

I'm attemping to leverage node-soap to make a SOAP request containing an array. 我正在尝试利用节点肥皂来进行包含数组的SOAP请求。 Requests without arrays seem to work fine however when attempting to pass an array I'm receiving the error 'not an ARRAY reference' from the server. 没有数组的请求似乎工作正常,但是当尝试传递数组时,我从服务器收到错误“不是数组引用”。

Any idea? 任何想法? My script is as follows: 我的脚本如下:

var soap = require('soap');

var url = 'http://example.com/example.wsdl';

var args = {
    email: 'example',
    password: 'xxxxx',
    series: {
        element: ['a', 'b', 'c', 'd']
    }
};

soap.createClient(url, function(err, client) {
    if(err) throw err;

    client.ExampleMethod(args, function(err, result) {
        if(err) throw err;
        console.log(result);
    });
});

不知道您要调用的代码应该做什么,但是只是从名称“ series”进行猜测,您确定一个叫做“ series”的东西应该包含一个名为“ element”的数组,而不是该数组?

Try this: 尝试这个:

series: {
    element: ['a', 'b', 'c', 'd']
}

This is currently being discussed over at the GitHub repository (issue #143) . 当前正在GitHub存储库(issue 143)上对此进行讨论。

tldr; tldr; The collaborators are trying to determine how they should convert JSON to XML. 合作者正在尝试确定如何将JSON转换为XML。 Which relates to issue #368 . 问题#368有关

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM