wsdl file and node.js

1,569 views
Skip to first unread message

Reza Razavipour

unread,
Sep 17, 2013, 2:35:52 PM9/17/13
to nod...@googlegroups.com
Thanks to all who helped me get milewise/node-soap compiled and installed :)

Now I adding creating a client from the wsdl file and I get the following error:

TypeError: Cannot call method 'GetGeoIP' of undefined

    at exports.list (/Users/rrazavipour-lp/Documents/workspace/Astute/routes/user.js:25:15)

    at options (/Users/rrazavipour-lp/node_modules/soap/lib/soap.js:46:9)

    at endpoint (/Users/rrazavipour-lp/node_modules/soap/lib/soap.js:30:24)

    at exports.open_wsdl (/Users/rrazavipour-lp/node_modules/soap/lib/wsdl.js:981:17)

    at Request._callback (/Users/rrazavipour-lp/node_modules/soap/lib/http.js:46:13)

    at Request.init.self.callback (/Users/rrazavipour-lp/node_modules/soap/node_modules/request/request.js:129:22)

    at Request.EventEmitter.emit (events.js:117:20)

    at ClientRequest.Request.init.self.clientErrorHandler (/Users/rrazavipour-lp/node_modules/soap/node_modules/request/request.js:239:10)

    at ClientRequest.EventEmitter.emit (events.js:95:17)

    at Socket.socketErrorListener (http.js:1528:9)

the WSDL has: 
<wsdl:operation name="GetGeoIP">
<http:operation location="/GetGeoIP"/>
<wsdl:input>
<http:urlEncoded/>
</wsdl:input>
<wsdl:output>
<mime:mimeXml part="Body"/>
</wsdl:output>
</wsdl:operation>

and my code is ultra simple...

var soap = require('soap');

  var url = 'http://http://www.webservicex.net/geoipservice.asmx?WSDL';

  var args = {name: 'value'};

  soap.createClient(url, function(err, client) {

      client.GetGeoIP(args, function(err, result) {

          console.log(result);

      });

  });


What am I missing?

Thanks

Reza


Angel Java Lopez

unread,
Sep 17, 2013, 3:00:52 PM9/17/13
to nod...@googlegroups.com
Ummm... first suggestion

  soap.createClient(url, function(err, client) {

      if (err) {

           console.log(err);

           return;

      }

      client.GetGeoIP(args, function(err, result) {

          console.log(result);

      });

  });

--
--
Job Board: http://jobs.nodejs.org/
Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nod...@googlegroups.com
To unsubscribe from this group, send email to
nodejs+un...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en
 
---
You received this message because you are subscribed to the Google Groups "nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nodejs+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Jerome Hwang

unread,
Sep 17, 2013, 5:15:41 PM9/17/13
to nod...@googlegroups.com
seems like  soap.createClient(url, function(err, client) returns null for client

you should check the "err" as Angel said, so you can make sure that the call was successful
--
University of Illinois at Urbana-Champaign
College of Engineering | BS in Computer Science
Tel: (517)203-9077 | E-mail: jhwa...@gmail.com

Reza Razavipour

unread,
Sep 17, 2013, 6:54:26 PM9/17/13
to nod...@googlegroups.com
changed the code and implemented your suggestions:

var soap = require('soap');

var url = 'http://www.webservicex.net/stockquote.asmx?WSDL';

var args = {

symbol : 'AMZN'

};

soap.createClient(url, function(err, client) {

client.GetQuote(args, function(err, result) {

if (err) {

console.log(err);

return;

}

console.log(result);

});

});


and in the console all i see is 

{ GetQuoteResult: [ 'exception' ] }

Thoughts?


Reza

Reza Razavipour

unread,
Sep 18, 2013, 7:28:47 PM9/18/13
to nod...@googlegroups.com
if I change the wsdl function to some invalid, I get an exception about a bad function 
so the GetQuote is correct and the result, not the error, is 
GetQuoteResult [ exception].

Any ideas? I am really stumped.

Ryan Schmidt

unread,
Sep 18, 2013, 8:24:59 PM9/18/13
to nod...@googlegroups.com

On Sep 18, 2013, at 18:28, Reza Razavipour wrote:

> if I change the wsdl function to some invalid, I get an exception about a bad function
> so the GetQuote is correct and the result, not the error, is
> GetQuoteResult [ exception].
>
> Any ideas? I am really stumped.

Does it work if you try to access this service using a different SOAP implementation -- one that doesn't use node, for example? If it doesn't work there either, then perhaps there's a misunderstanding about how to use this service, or the service is broken. You could contact the providers of the service.


Reza Razavipour

unread,
Sep 19, 2013, 1:43:35 PM9/19/13
to nod...@googlegroups.com
I use SOAPUI, a commercial product and it works fine, the return is as expected...
So the server is up, the function is correct and works...
Reply all
Reply to author
Forward
0 new messages