Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Web service in PERL

Status
Not open for further replies.

mmiller81

Programmer
Jan 28, 2005
3
US
I am trying to consume a web service in PERL. The code I am using is below. It doesn't return anything. Does anyone see any problems with the syntax or can point me to simular example that works.

#!/usr/bin/perl

use WebService::ServiceProxy;

print "Content-type: text/html","\n\n";
print "<html><head>";

my $wsdl = "my $AirportWeather = WebService::ServiceProxy->new($wsdl);
$AirportWeather->getTemperature("KLAX"); # Los Angeles

print"airportweather is -> $AirportWeather";
 
I don't know if I'm just having network issues, but the URL to that AirportWeather.wsdl gave me a 404 Not Found error.
 
Where did you find this module WebService::ServiceProxy ??
It's not even in cpan search
I wonder...


``The wise man doesn't give the right answers,
he poses the right questions.''
TIMTOWTDI
 
I've been using SOAP::Lite quite successfully to invoke web services and get the response back. It's part of the bulk-standard ActiveState install. I'll post a sample tomorrow (don't have it to hand on this PC) [smile]

Steve

[small]"Every program can be reduced by one instruction, and every program has at least one bug. Therefore, any program can be reduced to one instruction which doesn't work." (Object::PerlDesignPatterns)[/small]
 
Code:
my $ws = SOAP::Lite
        -> proxy("myURL")
        -> myWebMethod(SOAP::Data->name('myMethodParam' => $myValue));
    
print $ws->result()->{'myResponseParam'};

Steve

[small]"Every program can be reduced by one instruction, and every program has at least one bug. Therefore, any program can be reduced to one instruction which doesn't work." (Object::PerlDesignPatterns)[/small]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top