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

3564More fun with arrays

Expand Messages
  • gdhgdh
    May 10, 2004
    • 0 Attachment
      Hullo :)

      Can someone offer assistance because my poor Perl skills are really
      showing through here? I have a tiny SOAP::Lite client calling a
      method on a SOAP::Lite service, and though I can see all the
      elements of the returned array in a Dumper output, I cannot see how
      to access it via the SOAP::Lite methods.

      The client:

      #!/usr/bin/perl

      use SOAP::Lite +trace=>'debug';
      use Data::Dumper;

      $soap = SOAP::Lite
      -> uri('System')
      -> proxy('http://my.server.ip/');

      $soapcall = $soap->getCurrentIP();
      print Dumper($soapcall);
      @lansettings = $soapcall->result;
      print "Current LAN settings:\n\n";
      print " IP Address: $lansettings[0]\n";
      print " Subnet Mask: $lansettings[1]\n";
      print " Default Gateway: $lansettings[2]\n";

      Unfortunately, the @lansettings array only has one element. I've
      omitted the full Dumper output for the sake of brevity, (it's at
      http://gdh.ca/dump.txt ) but the SOAP::Lite trace is as follows:

      SOAP::Transport::HTTP::Client::send_receive: POST
      http://my.server.ip/
      Accept: text/xml
      Accept: multipart/*
      Content-Length: 438
      Content-Type: text/xml; charset=utf-8
      SOAPAction: "System#getCurrentIP"

      <?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope
      xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
      SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
      xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
      xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
      xmlns:xsd="http://www.w3.org/1999/XMLSchema"><SOAP-ENV:Body><namesp1:getCurrentIP
      xmlns:namesp1="System"/></SOAP-ENV:Body></SOAP-ENV:Envelope>


      SOAP::Transport::HTTP::Client::send_receive: HTTP/1.1 200 OK
      Date: Mon, 10 May 2004 14:49:29 GMT
      Server: libwww-perl-daemon/1.25
      Content-Length: 659
      Content-Type: text/xml; charset=utf-8
      Client-Date: Mon, 10 May 2004 14:50:00 GMT
      Client-Response-Num: 1
      SOAPServer: SOAP::Lite/Perl/0.55

      <?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope
      xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
      SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
      xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
      xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
      xmlns:xsd="http://www.w3.org/1999/XMLSchema"><SOAP-ENV:Body><namesp14:getCurrentIPResponse
      xmlns:namesp14="System"><s-gensym86
      xsi:type="xsd:string">82.49.223.14</s-gensym86><s-gensym88
      xsi:type="xsd:string">255.255.255.240</s-gensym88><s-gensym90
      xsi:type="xsd:string">82.49.223.11</s-gensym90></namesp14:getCurrentIPResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>

      Can anyone offer a push in the right direction?

      Thank you,
      Gavin.
    • Show all 3 messages in this topic