Hi Monks, I have to port an application from Unix to Linux box and I am facing issue in one of the web service call the application is making: I am performing a web service call using SOAP::Lite (1.10) and below the XML response received (printing it using Data Dumper):
$VAR1 = bless( { '_content' => [ 'SOAP:Envelope', { 'xmlns:SOAP' => 'http://schemas.xml +soap.org/soap/envelope/' }, [ [ 'SOAP:Header', {}, '', undef, '', '{http://schemas.xmlsoap.org/soap +/envelope/}Header', {} ], [ 'SOAP:Body', {}, [ [ 'ns0:MT_LABEL_IN', { 'xmlns:ns0' => 'http://emdc +hemicals.com/xi/label/masterdata' }, [ [ 'HEADER', {}, [ [ 'material', {}, '12659-250GM', undef, '12659-250GM', 'material', {} ], [ 'batch', {}, 'D00166202', undef, 'D00166202', 'batch', {} ], [ 'material_desc', {}, 'Albumin, Bovine Seru +m, Fract 1PC x 250GM', undef, 'Albumin, Bovine Seru +m, Fract 1PC x 250GM', 'material_desc', {} ], [ 'plant', {}, 'US05', undef, 'US05', 'plant', {} ] ], undef, { 'batch' => 'D00166202', 'plant' => 'US05', 'material_desc' => 'Alb +umin, Bovine Serum, Fract 1PC x 250GM', 'material' => '12659-25 +0GM' }, 'HEADER', {} ] ], undef, { 'HEADER' => $VAR1->{'_conte +nt'}[2][1][2][0][2][0][4] }, '{http://emdchemicals.com/xi/ +label/masterdata}MT_LABEL_IN', {} ] ], undef, { 'MT_LABEL_IN' => $VAR1->{'_cont +ent'}[2][1][2][0][4] }, '{http://schemas.xmlsoap.org/soap +/envelope/}Body', {} ] ], undef, { 'Body' => $VAR1->{'_content'}[2][1] +[4], 'Header' => '' }, '{http://schemas.xmlsoap.org/soap/env +elope/}Envelope', {} ], '_context' => undef, '_current' => [ $VAR1->{'_content'} ] }, 'SOAP::SOM' );
Now when i am trying to access the values in the Header Tag: print Dumper ($a->{_value}); where $a is $xmlResponse->dataof("//MT_LABEL_IN/*")
$VAR1 = [ \bless( { '_signature' => [], '_value' => [ bless( { '_name' => 'material', '_signature' => [], '_value' => [ '12659-250GM +' ], '_prefix' => '', '_attr' => {} }, 'SOAP::Data' ), bless( { '_name' => 'batch', '_signature' => [], '_value' => [ 'D00166202' ], '_prefix' => '', '_attr' => {} }, 'SOAP::Data' ), bless( { '_name' => 'material_desc' +, '_signature' => [], '_value' => [ 'Albumin, Bo +vine Serum, Fract 1PC x 250GM' ], '_prefix' => '', '_attr' => {} }, 'SOAP::Data' ), bless( { '_name' => 'plant', '_signature' => [], '_value' => [ 'US05' ], '_prefix' => '', '_attr' => {} }, 'SOAP::Data' ) ], '_attr' => {} }, 'SOAP::Data' ), {} ];
The issue is that I am not able to pull the values of tag's' like plant, material_desc etc.

Could someone please let me know how to perform this?

Best Regards,
Abhijit Singh Dahiya

In reply to SOAP::Lite Response Parsing by Abhijit10089

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.