Hello Every one, Looking for some help and will be great if some one can help on parsing soap lite response.
#!/usr/bin/perl use SOAP::Lite;# +trace => [ transport => sub { print $_[0]->as_string + } ]; $SOAP::Constants::PREFIX_ENV = "soapenv"; $SOAP::Constants::PREFIX_ENC = "soapenc"; my $soapRequest = SOAP::Lite -> uri('XXX') -> readable(1) -> ns('XXX') -> proxy('XXX'); my $Username = SOAP::Header->name('wsse:Username' => $username); my $Password = SOAP::Header->name('wsse:Password') ->attr({'Type'=>'http://docs.oasis-open.org +/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText +'}) ->value($password); my $UsernameToken = SOAP::Header->name('wsse:UsernameToken') ->value(\SOAP::Header->value($Username,$Passwo +rd)); my $security = SOAP::Header->name('wsse:Security') ->attr ({'soapenv:mustUnderstand'=>'1', 'xmlns:wsse' => 'http://docs.oasis-o +pen.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd' }) ->value(\SOAP::Header->value($UsernameToken)); my $bsvc_ID = SOAP::Data ->name('had:Proxy_User_Name') ->value('XXX'); my $bsvc_ID1 = SOAP::Data ->name('had:Proxy_Password') ->value('XXX'); my $Int_ID = SOAP::Data ->name('had:Authentication') ->value(\SOAP::Data->value($bsvc_ID,$bsvc_ID1) +); my $Employee_Reference = SOAP::Data ->name('had:Report_Parameters') ->value(\SOAP::Data->value($Int_ID)); my $params = SOAP::Data ->name('had:Execute_Report') ->value(\SOAP::Data->value($Employee_Reference +)); $soapRequest->call($params,$Employee_Reference,$security);
Above is my code which makes a SOAP call and returns me an output
<?xml version='1.0' encoding='UTF-8'?> <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"> <env:Body> <wd:Report_Data xmlns:wd="urn:com.workday.report/Hadoop_Master_Integration +_Event"> <wd:Report_Entry> <wd:Workday_ID>6c995364b0311079b40f3b5067d12175</wd:Wo +rkday_ID> </wd:Report_Entry> </wd:Report_Data> </env:Body> </env:Envelope>
Now what I want to do is pick 6c995364b0311079b40f3b5067d12175 from the soap result and use it in another soap call. I have read many forums but couldnt get conclusive answer. All I need 6c995364b0311079b40f3b5067d12175 into a variable which I can then use further?

In reply to How to Parse SOAP::Lite response by PERL_fresher

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.