Wednesday, December 14, 2005

Invoke WebService from Perl script

Hi,
Here the small utility, perl script can invoke the webservice......just specifying the service address.

-----------------------------------------------------------------------------------------------
#!/usr/bin/perl
use Net::Ping;use SOAP::Lite;
$host = "casshost";$wshost = "peinguin";
$p = Net::Ping->new();$alive = $p->ping($host);if ( $alive ){ print "Host is up - $host.\n"}else{ print "Host is down - $host.\n";}$p->close();
$soap_response = SOAP::Lite -> uri('http://penguin:48080/WebSTARS/services/WSCassHostManager') -> proxy('http://penguin:48080/WebSTARS/services/WSCassHostManager') -> updateHostStatus("perl", "perl", $alive);
@res = $soap_response->paramsout;
$res = $soap_response->result;#print "Result is $res, outparams are @res\n";print "Result is $res.\n";
-----------------------------------------------------------------------------------------------

the url is specific to your service locator.

just save the file with the extension .pl and run in ur linux box.

Actually this program will ping one of the remote host, if the system available or may not available the perl script invoke the service and give the result.

Its really good stuff.

Tq.

1 Comments:

At 6:26 PM, Blogger eddhunor0524 said...

I read over your blog, and i found it inquisitive, you may find My Blog interesting. My blog is just about my day to day life, as a park ranger. So please Click Here To Read My Blog

http://www.juicyfruiter.blogspot.com

 

Post a Comment

<< Home