Hi,

my requirment is too call a web service using perl into one of my clients webservice which is build in jason(i guess). all the information i got is the url to acess ($URL="http://testgenes.com/servlet/sync?) and i have to Pass some information to its such as($data="pid=12&name=test"); this will update some tables @their background( i have no info on that) and in return it will send some text as out put.
more over the perl script will be executed in command line part of an internal pipeline

I tried to go through soap and LWP for the same but with the limited information in my hand such as above i could'n get it right

Code:1 use LWP::UserAgent; my $input ="pid=12&name=test"; my $ua = LWP::UserAgent->new; $ua->agent("apple"); my $req = HTTP::Request->new(POST => http://test.com/servlet/sync?'); $req->content_type('text/html'); $req->content("$input"); # Pass request to the user agent and get a response back my $res = $ua->request($req); # Check the outcome of the response if ($res->is_success) { print $res->content; } else { print $res->status_line, "\n"; } ####################################### Code:2 use SOAP::Lite; my $soap = SOAP::Lite->new( proxy => 'http://test.com/servlet/sync?'); my $som = $soap->call('sayHello', SOAP::Data->name('pid')->value('12'), SOAP::Data->name('name')->value('test') ); die $som->faultstring if ($som->fault); print $som->result, "\n";

none of the code worked..Please find me the simplest ay to do the same and also a referral which gives info in a simple sentences


In reply to call web service by vinumanikandan

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.