I'm trying to write a script to access a web service. It returns XML in the form of a hash. I can't seem to access the data. The code I'm using looks like this:
use strict; use SOAP::Lite 'trace', 'debug'; use Mime::Base64 (); use XML::Simple; use Data::Dumper; my $loginToken = '209a2247-df9a-40f9-a7e1-6b755f184947'; my $messageID = '783679'; my $pageNumber = 1; my $server = SOAP::Lite ->uri('https://www.onecallnow.com/WebService/') ->on_action( sub { join '/', 'https://www.onecallnow.com/WebSe +rvice', $_[1] } ) #->proxy('http://localhost/WebService/OneCallNow.asmx?wsdl'); ->proxy('http://dev.onecallnow.com/WebService/OneCallNow.asmx? +wsdl'); my $returned = $server ->call(SOAP::Data->name('RetrieveMessageReportDetails')->attr({xml +ns => 'https://www.onecallnow.com/WebService/'}) => SOAP::Data->name('LoginToken')->value($loginToken)->type('s +:string'), SOAP::Data->name('MessageID')->value($messageID)->type('s:i +nt'), SOAP::Data->name('PageNumber')->value($pageNumber)->type('s +:int') ); my $xml = $returned->result;
(the loginToken and messageID will have expired by the time you read this) And the XML should look like this:
<Message MessageID="12345" PageNumber="1" PageCount="1" MinRecord="1" +MaxRecord="123"> <Deliveries> <Delivery Attempts="1" CallCreditsUsed="1.00"> <DeliveryStatus>Delivered to person</DeliveryStatus> <PhoneNumber>123-456-7890</PhoneNumber> <Name>John Smith</Name> <Delivered>02/06-2008 4:19 PM</Delivered> <TimeZone>CT</TimeZone> </Delivery> </Deliveries> </Message>
I've tried using a data dump, and the information is in there. Can anyone help me? Thanks in advance.

In reply to SOAP::Lite HASH by daChf

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.