Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SOAP::Lite Printing results

Status
Not open for further replies.

fritz1968j

Programmer
Aug 14, 2012
1
US
Hello,

I am having trouble extracting data from my SOAP::Lite program. I can connect to the WSDL just fine. It even returns data. 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(' ->readable(1);


$response = $lite->call(
SOAP::Data->name('fetchAndLock')
->attr({ 'xmlns', ' }),
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($param);
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=" xmlns:S
OAP-ENC=" xmlns:SOAP-ENV="as.xmlsoap.org/soap/envelope/" xmlns:xsd=" SOAP
-ENV:encodingStyle=">
<SOAP-ENV:Body
>
<fetchAndLock xmlns=" >
<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:Envelope>
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="
<soap:Body>
<fetchAndLockResponse xmlns="
<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? Any help would be greatly appreciated.
Frank
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top