Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

SOAP::Lite, WSDL and the example

by Sifmole (Chaplain)
on Jan 21, 2007 at 04:18 UTC ( #595722=perlquestion: print w/ replies, xml ) Need Help??
Sifmole has asked for the wisdom of the Perl Monks concerning the following question:

All, I am trying to figure out how to use SOAP::Lite for calling webservices, specifically using the wsdl variation in SOAP::Lite. The only example ( the stock quote ) for wsdl simply does not work for me -- I get back a blank, and the trace shows that there is a null exception error at the far end. However, when I use a GUI tool to make the call it works fine. When I compare the XML being sent by the two they are very, very different -- the GUI one is pretty clean and easy to read and the SOAP::Lite is a bit more cluttered ( I understand the far side doesn't care, but I just wanted to indicate that they are different. )
use SOAP::Lite; print SOAP::Lite -> service('http://www.xmethods.net/sd/StockQuoteService.wsdl') -> getQuote('MSFT');
Any ideas? Is there a better library out there to use for this purpose than SOAP::Lite? I see SOAP::WSDL but it doesn't seem to be maintained at this point. Any pointers would be greatly appreciated.

Comment on SOAP::Lite, WSDL and the example
Download Code
Re: SOAP::Lite, WSDL and the example
by Khen1950fx (Canon) on Jan 21, 2007 at 11:25 UTC
    I tried this:

    #!/usr/bin/perl use SOAP::Lite; use SOAP::WSDL; use strict; use warnings; my $service = SOAP::Lite; -> service('http://www.xmethods.net/sd/StockQuoteService.wsdl'); print "MSFT ", $service->getQuote('MSFT'), "\n";
      You have an extra ; after Lite ... use the following: my $service = SOAP::Lite -> service('http://www.xmethods.net/sd/StockQuoteService.wsdl');
Re: SOAP::Lite, WSDL and the example
by jhourcle (Prior) on Jan 21, 2007 at 13:10 UTC

    The example worked for me (printed '31.11')

    As understand it, the functionality of SOAP::WSDL has been rolled into SOAP::Lite.

    I am, however, running an older version of SOAP::Lite -- 0.60 on the system I tested from, and I don't think I have any systems running greater than 0.67 (make test fails for me on 0.68 and 0.69, and I haven't had a chance to figure out just what's going on, but I don't need any of the new functionality, so I just used older versions)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://595722]
Approved by gam3
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (11)
As of 2014-12-29 13:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (188 votes), past polls