Hello,

I am having trouble extracting data from my SOAP::Lite program. I can connect to the WSDL just fine. It even returns data. (I know because Dumper tells me it is there). My problem is trying to put said data into a variable. Here is my code:-------------------------------------------------------------------

#! /usr/bin/perl use SOAP::Lite +trace => 'debug'; use Data::Dumper; # .NET web services expect / as a separator # for uri and method. my $lite = SOAP::Lite->new()->on_action(sub { join '/', @_ } ) ->proxy('http://somewhere.net/rjam-request-service/svc/RequestServic +e/3?wsdl') ->readable(1); $response = $lite->call( SOAP::Data->name('fetchAndLock') ->attr({ 'xmlns', 'http://somewhere.net/request/servic +e/3' }), SOAP::Data->name("first")->value(3), SOAP::Data->name("max")->value(1), SOAP::Data->name("provider")->value('homeFolderWin'), SOAP::Data->name("action")->value('bestMatch'), SOAP::Data->name("state")->value('PLACED') ); my $tmp_data = $response->valueof('[1]'); print Dumper($tmp_data); my $lts=$tmp_data->dataof('//fetchAndLockResponse/request/lockedTimes' +);

and here is what is returned on my command prompt (note that I cleaned up the response a bit to make it more readable): -------------------------------------------------------------------------

<?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/1999/XMLSchema-instanc +e" xmlns:S OAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="ht +tp://schem as.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/1999/XMLSc +hema" SOAP -ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" > <SOAP-ENV:Body > <fetchAndLock xmlns="http://somewhere.net/request/service/3" > <first xsi:type="xsd:int" >3</first> <max xsi:type="xsd:int" >1</max> <provider xsi:type="xsd:string" >homeFolderWin</provider> <action xsi:type="xsd:string" >bestMatch</action> <state xsi:type="xsd:string" >PLACED</state></fetchAndLock></SOAP-ENV:Body></SOAP-ENV:Envelop +e> SOAP::Transport::HTTP::Client::send_receive: HTTP/1.1 200 OK Connection: close Date: Tue, 14 Aug 2012 12:31:38 GMT Server: IBM_HTTP_Server Content-Language: en-US Content-Type: text/xml; charset=UTF-8 Client-Date: Tue, 14 Aug 2012 12:31:38 GMT Client-Peer: 169.81.175.20:80 Client-Response-Num: 1 Client-Transfer-Encoding: chunked <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <fetchAndLockResponse xmlns="http://somewhere.net/request/serv +ice/3"> <request> <id>210</id> <client>TESTING</client> <externalId>homefoldertest1241</externalId> <externalParentId>TODO</externalParentId> <provider>homeFolderWin</provider> <action>bestMatch</action> <priority>1</priority> <actionTime>2012-07-13T16:20:34.993Z</actionTime> <state>PLACED</state> <result>NONE</result> <locked>true</locked> <lockedTimes>43</lockedTimes> <arguments> <name>sid</name> <valueString>F030624</valueString> </arguments> <arguments> <name>domain</name> <valueString>NAEAST</valueString> </arguments> </request> </fetchAndLockResponse> </soap:Body> </soap:Envelope> Can't call method "dataof" on unblessed reference at test.pl line 28. ---------------------------------------------------------------------- +----------------
why cannot I extract the locked times from using the dataof part? (I have the same problem with valueof). Any help would be greatly appreciated. Frank

In reply to soap::lite - Can't call method "dataof" on unblessed reference by fritz1968

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.