For more information on Perl and WebServices I recommend: Programming Web Services with Perl
To access SOAP web services with Perl, I recommend the SOAP::Lite CPAN module. If you don't have SOAP::Lite already installed you can install it by issuing the following commands and answering any prompts.
perl -MCPAN -e shell
CPAN> install SOAP::Lite
Here is a simple example perl call that calls the stock quote webservice at http://www.webservicex.net/stockquote.asmx?wsdl.
use strict;
use SOAP::Lite +trace => 'debug';
my $soap = SOAP::Lite->new();
my $serializer = $soap->serializer();
my $service = $soap->service('http://www.webservicex.net/stockquote.asmx?wsdl');
print $service->GetQuote("nvda");
Note: The recent version of SOAP::Lite appears to have a bug, when the service is a newer one like a .NET or axis the above code doesn't work. I can't find any indication that SOAP::Lite developers are going to fix this or not. If anyone has any information let me know.
No comments:
Post a Comment