return FALSE; $r = well_tag_thread__update(array('id' => $id), $update); return $r; } function well_tag_thread_find($tagid, $page, $pagesize) { $arr = well_tag_thread__find(array('tagid' => $tagid), array('id' => -1), $page, $pagesize); return $arr; } function well_tag_thread_find_by_tid($tid, $page, $pagesize) { $arr = well_tag_thread__find(array('tid' => $tid), array(), $page, $pagesize); return $arr; } ?>javascript - Node.js - Problems using the SOAP library - Stack Overflow
最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Node.js - Problems using the SOAP library - Stack Overflow

programmeradmin3浏览0评论

I am trying to use this package:

However, when I do this:

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

It returns back: "undefined".

My question is I don't understand when it says "args". Is it to do with the nodes in the WDSL?

The WSDL file is as follows:

<xsd:element name="getAllMarkets">
  <xsd:plexType>
    <xsd:sequence>
      <xsd:element name="request" type="types:GetAllMarketsReq"/>
    </xsd:sequence>
  </xsd:plexType>
</xsd:element>

Please help. Thanks.

I am trying to use this package: https://github./milewise/node-soap

However, when I do this:

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

It returns back: "undefined".

My question is I don't understand when it says "args". Is it to do with the nodes in the WDSL?

The WSDL file is as follows:

<xsd:element name="getAllMarkets">
  <xsd:plexType>
    <xsd:sequence>
      <xsd:element name="request" type="types:GetAllMarketsReq"/>
    </xsd:sequence>
  </xsd:plexType>
</xsd:element>

Please help. Thanks.

Share Improve this question asked Aug 12, 2011 at 10:19 RonRon 211 silver badge2 bronze badges 1
  • 1 I had to patch soap.js to get it to work with Betfair API but it's a very ugly hack. Hoping to see some nicer solutions here. – mak Commented Aug 12, 2011 at 10:31
Add a ment  | 

3 Answers 3

Reset to default 3

You are logging result, which is probably undefined because there's an error, meaning the err argument to your callback function IS defined and will have info for you. In this case since it looks like you're calling MyFunction instead of getAllMarkets, your error will probably be some sort of "Unknown Method" error. Do console.log(err, result); and see what that prints out.

instead of this :

var args = {name: 'value'};

try this :

var args = {'tns:name': 'value'};

its worked for me.

try

var args = { request: { name: 'value' } };
发布评论

评论列表(0)

  1. 暂无评论