Hi,

I had to smile seeing that Anonymous Monk gave a snippet hopefully extracting information from Body while you asked for Header, but probably he wanted to test your transfer capabilities.

Here is my snippet in the hope it helps you:

#!/usr/bin/perl use strict; use warnings; use Data::Dumper; use local::lib 'lib1'; use SOAP::Lite; my $xml = q{<?xml version="1.0" encoding="utf-8"?> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/e +nvelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="htt +p://www.w3.org/2001/XMLSchema-instance"> <soapenv:Header> <ns1:sessionID soapenv:actor="http://schemas.xmlsoap.org/s +oap/actor/next" soapenv:mustUnderstand="0" href="#id0" xmlns:ns1="htt +p://xml.apache.org/axis/session"/> </soapenv:Header> <soapenv:Body> <ns2:initExportDeviceResponse soapenv:encodingStyle="http: +//schemas.xmlsoap.org/soap/encoding/" xmlns:ns2="http://diamondip.com +/netcontrol/ws/"> <initExportDeviceReturn href="#id1"/> </ns2:initExportDeviceResponse> <multiRef id="id0" soapenc:root="0" soapenv:encodingStyle= +"http://schemas.xmlsoap.org/soap/encoding/" xsi:type="soapenc:long" x +mlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">-91025392591 +2285490</multiRef> <multiRef id="id1" soapenc:root="0" soapenv:encodingStyle= +"http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns3:WSContext" +xmlns:ns3="http://service.ipcontrol.diamondip.com" xmlns:soapenc="htt +p://schemas.xmlsoap.org/soap/encoding/"> <contextId xsi:type="soapenc:string">ContextId_1364228 +178892</contextId> <contextType xsi:type="soapenc:string">Export_Device</ +contextType> <filter xsi:type="soapenc:string">DeviceType='NAS'</fi +lter> <firstResultPos href="#id2"/> <internalResultCount href="#id3"/> <maxResults href="#id4"/> <options xsi:type="soapenc:string" xsi:nil="true"/> <query xsi:type="soapenc:string">SELECT DISTINCT huge- +ass sql statement cropped for clarity) ) ) ) ) ORDER BY 1</query> <resultCount href="#id5"/> </multiRef> <multiRef id="id4" soapenc:root="0" soapenv:encodingStyle= +"http://schemas.xmlsoap.org/soap/encoding/" xsi:type="xsd:int" xmlns: +soapenc="http://schemas.xmlsoap.org/soap/encoding/">5000</multiRef> <multiRef id="id3" soapenc:root="0" soapenv:encodingStyle= +"http://schemas.xmlsoap.org/soap/encoding/" xsi:type="xsd:int" xmlns: +soapenc="http://schemas.xmlsoap.org/soap/encoding/">0</multiRef> <multiRef id="id5" soapenc:root="0" soapenv:encodingStyle= +"http://schemas.xmlsoap.org/soap/encoding/" xsi:type="xsd:int" xmlns: +soapenc="http://schemas.xmlsoap.org/soap/encoding/">152</multiRef> <multiRef id="id2" soapenc:root="0" soapenv:encodingStyle= +"http://schemas.xmlsoap.org/soap/encoding/" xsi:type="xsd:int" xmlns: +soapenc="http://schemas.xmlsoap.org/soap/encoding/">0</multiRef> </soapenv:Body> </soapenv:Envelope> }; my $som = SOAP::Deserializer->deserialize($xml); my $subsom = $som->match('/Envelope/Header/[1]'); my $res = $subsom->valueof(); print "Result: $res\n";

McA


In reply to Re: SOAP::Lite Client - Read response header by McA
in thread SOAP::Lite Client - Read response header by sojourner9

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.