Loading ...
Sorry, an error occurred while loading the content.

4830Re: [soaplite] Handling LoLs (List of Lists, Structs, Objects, or something else)

Expand Messages
  • Duncan Cameron
    Aug 4 12:49 PM
    • 0 Attachment
      At 2005-08-04, 11:03:18 you wrote:

      >Hello,
      >
      >I have a problem putting the result of a soap client return into a
      >list. Somehow I always end up with just one entry. Does anyone know
      >what to do to get everything back?
      >
      >here is the script and the output:
      >
      >#!perl -w
      >
      >#use SOAP::Lite;
      >use SOAP::Lite +trace => 'debug';
      >
      >my $NS="http://www.marimba.com/depmgr/schema/soap/";
      >my $soap = SOAP::Lite
      > -> uri($NS)
      > -> proxy('http://marimbaet.csintra.net:8889/soap/', timeout =>
      >10);
      >
      >my $result = $soap->CommandLine(SOAP::Data->name(Argument => '-
      >login'),
      > SOAP::Data->name('Argument' => 'admin:xxxx'),
      > SOAP::Data->name('Argument'
      >=> '-show'),
      > SOAP::Data->name('Argument'
      >=> 'fsktd'),
      > SOAP::Data->name('Argument'
      >=> '/')
      > );
      >
      >
      >unless ($result->fault) {
      > print $result->result;
      > @listings = @{$result->result};
      > foreach (@listings) {
      > print "$_\n";
      > }
      > } else {
      > print $result->faultcode, " ", $result->faultstring, "\n";
      >
      > #print join ', ',
      > # $result->faultcode,
      > # $result->faultstring,
      > # $result->faultdetail;
      >}
      >
      >output:
      >--------------------------------------------------------
      >SOAP::Transport::HTTP::Client::send_receive: POST
      >http://marimbaet.csintra.net:8889/soap/
      >Accept: text/xml
      >Accept: multipart/*
      >Content-Length: 741
      >Content-Type: text/xml; charset=utf-8
      >SOAPAction: "http://www.marimba.com/depmgr/schema/soap/#CommandLine"
      >
      ><?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope
      >xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:SOAP-
      >ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-
      >ENV="http://schemas.xmlsoap.org/soap/envelope/"
      >xmlns:xsd="http://www.w3.org/1999/XMLSchema" SOAP-
      >ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-
      >ENV:Body><namesp1:CommandLine
      >xmlns:namesp1="http://www.marimba.com/depmgr/schema/soap/"><Argument
      >xsi:type="xsd:string">-login</Argument><Argument
      >xsi:type="xsd:string">admin:marimbaDM</Argument><Argument
      >xsi:type="xsd:string">-show</Argument><Argument
      >xsi:type="xsd:string">fsktd</Argument><Argument
      >xsi:type="xsd:string">/</Argument></namesp1:CommandLine></SOAP-
      >ENV:Body></SOAP-ENV:Envelope>
      >SOAP::Transport::HTTP::Client::send_receive: HTTP/1.1 200 OK
      >Connection: Keep-Alive
      >Date: Thu, 04 Aug 2005 09:49:59 GMT
      >Server: CSF/1.0
      >Content-Length: 578
      >Content-Type: text/xml
      >Client-Date: Thu, 04 Aug 2005 09:49:59 GMT
      >Client-Response-Num: 1
      >Set-Cookie: id="xxZM2GAoAq2L7P86mPZngQ=="; path=/
      >
      ><SOAP-ENV:Envelope xmlns:SOAP-
      >ENV="http://schemas.xmlsoap.org/soap/envelope/">
      > <SOAP-ENV:Body>
      > <DepMgr:CommandLineResponse
      >xmlns:DepMgr="http://www.marimba.com/depmgr/schema/soap/">
      > <DepMgr:OutputLine xml:space="preserve">
      >[F] /</DepMgr:OutputLine>
      > <DepMgr:OutputLine xml:space="preserve">
      >[F] /FIT/</DepMgr:OutputLine>
      > <DepMgr:OutputLine xml:space="preserve">
      >[F] /Marimba/</DepMgr:OutputLine>
      > <DepMgr:OutputLine xml:space="preserve">
      >[F] /RTP_WIN/</DepMgr:OutputLine>
      > </DepMgr:CommandLineResponse>
      > </SOAP-ENV:Body>
      ></SOAP-ENV:Envelope>
      >
      >[F] /
      >
      >
      Hi Frank

      You need to navigate throught the SOM object that is returned by your call and pick out the repeating bits. See this previous post for an example

      http://groups.yahoo.com/group/soaplite/message/3694

      Duncan
    • Show all 4 messages in this topic