1

我们正在使用soap 包来使用Node.js 中的SOAP 服务。要调用方法,我们使用 args 对象来传递值。

    var soap = require('soap');
    var url = 'http://example.com/wsdl?wsdl';
    var args = {name: 'value'};
    soap.createClient(url, function(err, client) {
       client.MyFunction(args, function(err, result) {
          console.log(result);
       });
    });

现在的问题是,如果参数值是字符串,我们可以直接传入 args 对象。假设如果参数数据类型是 OptionSetValue 那么我们如何传递呢?

     <con:KeyValuePairOfstringanyType>
       <sys:key>customer_type</sys:key>
       <sys:Value i:type="con:OptionSetValue">
         <con:Value>100000000</con:Value>
       </sys:Value>
     </con:KeyValuePairOfstringanyType>

我们如何 在 args 对象中传递customer_type的值?

4

0 回答 0