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.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.