Dear Monks, I am completely new to SOAP and trying to write a client for a web service our company intend to use.



My problem is that i am not able to figure out why this code does not fill up $response. I am pasting my code..

my $webService = SOAP::Lite-> uri($self->{NAMESPACE}) -> on_action(sub{sprintf '%s/%s', @_ }) -> outputxml("1") -> proxy($self->{ENDPOINT}); eval{ my $response = $webService ->call(SOAP::Data->name("SubmitXml")->attr({xmlns => $self->{NAM +ESPACE}}), SOAP::Data->name(Profile => $self->{HAP})->type('string') +, SOAP::Data->name(Request => $xmlRequest)->type('xml'), SOAP::Data->name(Filter => $xmlFilter)->type('xml')); }; if($@){print $@} open RES,">>Responce.log"; if (defined $response) { print RES $response."\n"; }else {print RES "========No Response======== \n";} close RES;

but i can see the proper response if i enable +trace on it shows me the right result but does not return it . please help me as I always end up with undefined $response.
i tried this $response=$webService->result; but the wsdl raised error saying that it does not expect this method,which was recorded in the log


This is server response seen in trace output as displayed on screen.
SOAP::Transport::HTTP::Client::send_receive: HTTP/1.1 200 OK Connection: close Date: Wed, 21 Jun 2006 10:44:06 GMT Server: Apache-Coyote/1.1 Content-Length: 4059 Content-Type: text/xml;charset=utf-8 Client-Date: Wed, 21 Jun 2006 10:45:18 GMT Client-Response-Num: 1 Client-SSL-Cert-Issuer: /O=VeriSign Trust Network/OU=VeriSign, Inc./OU +=VeriSign International Server CA - Class 3/OU=www.verisign.com/CPS I +ncorp.by Ref. LIABILITY LTD.(c)97 VeriSign Client-SSL-Cert-Subject: /C=US/ST=New Jersey/L=Parsippany/O=Cendant Co +rporation/OU=Terms of use at www.verisign.com/OU=Terms of use at www. +verisign.com/rpa (c)00/CN=copyws.cendant.com Client-SSL-Cipher: AES256-SHA Client-SSL-Warning: Peer certificate not verified <?xml version="1.0" encoding="UTF-8"?> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envel +ope/" xmlns:xsd="http://www.w3.org/1999/XMLSchema" xmlns:xsi="http:// +www.w3.org/1999/XMLSchema-instance"> <soapenv:Body> <SubmitXmlResponse xmlns=""> <SubmitXmlResult> <AirAvailability_6_2 xmlns=""><AirAvail><MoreToken><Tok>3 +01030383628882023605530276080</Tok></MoreToken><AvailSummary><NumSegs +>2</NumSegs></AirAvail></AirAvailability_6_2> </SubmitXmlResult> </SubmitXmlResponse> </soapenv:Body></soapenv:Envelope>

now according to me the $response should have this string as i have enabled the outputxml(1) .


In reply to About SOAP ::Client written by me by mohan123

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.