Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Perl Web Services

by msk_0984 (Friar)
on Mar 12, 2012 at 20:09 UTC ( [id://959169]=perlquestion: print w/replies, xml ) Need Help??

msk_0984 has asked for the wisdom of the Perl Monks concerning the following question:

Hello Monks,
I am new to Web Services with Perl and trying to develop a code to communicate with a Web Server and request for information and pull that information to be displayed as output.
Below is the code which I have used to run the script and it is successful in Authentication and Fails at the getting the request. I have used "call" and "get" but all of them are failing and the perl script exits at that line.
I know this is a minor mistake but would definitely appreciate if you could direct me in the right format that would be greatly appreciated.
#! /usr/bin/perl use strict; use SOAP::Lite; SOAP::Lite->import(+trace => qw(debug)); my ($server, $endpoint, $soapaction, $method, $method_urn); $server = 'http://xx.xx.xxx.xxx'; $soapaction = "urn:getTicketIDbyKey/getTicketIDbyKey"; $endpoint = "$server/arsys/WSDL/protected/uet/getTicketIDbyKey"; $method = 'getTicketIDbyKey'; $method_urn = 'urn:getTicketIDbyKey'; print "I am here \n"; my $s = SOAP::Lite->new( uri => $soapaction, proxy => $endpoint, timeout => 5, credentials => [ '10.62.242.171:80', # host:port 'SOAP::Lite authentication tests', # realm 'ncoadmin' => 'password', # user, + password ]); print "I am after decalration \n"; print "I am before extraction of result \n"; #my $som = $s->call("getTicketIDbyKey", # SOAP::Data->name('TicketKey')->value('115R') #); # die $som->fault->{ faultstring } if ($som->fault); # print $som->result, "\n"; print $s->getTicketIDbyKey(SOAP::Data->name('TicketKey' => '115R'))->r +esult; die $s->fault->{ faultstring } if ($s->fault); print $s->result, "\n"; #my $r = $s->getResults(SOAP::Data->name(TicketKey => 'UNO000022539476 +')) # ->result; #print $r->result; print "I am before EXIT \n"; exit;
Please let me know if you need any further information. Thanks for your assistance.

Sushil Kumar

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2024-04-19 20:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found