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

Re: [soaplite] How do I access a return value that is an array?

Expand Messages
  • Duncan Cameron
    ... When you use a WSDL the call returns the actual data from the server not a som object. SO your first call is correct, but why does your second call expect
    Message 1 of 2 , Aug 6, 2004
    • 0 Attachment
      At 2004-08-06, 03:03:54 Larry Helmerich <lhelmerich@...> wrote:

      >I'm new to both SOAP::Lite and Perl
      >
      >I have a webservice with two methods.
      >The first method is passed a String and returns a String
      >The seond method is passed a String and returns an Array of Strings.
      >
      >Here is my program
      >
      >#use SOAP::Lite + trace => 'debug';
      >use SOAP::Lite;
      >my $ipAddr = $ARGV[0];
      >my $wsdl = "http://localhost:8080/locate-jaxrpc/loc
      >my $service = SOAP::Lite->service($wsdl);

      >print $service->getMacByIp($ipAddr), "\n";
      >$som = $service->browseByIp($ipAddr);
      >print $som->valueof('//browseByIpResponse');

      When you use a WSDL the call returns the actual data from the server
      not a som object. SO your first call is correct, but why does your
      second call expect a som object?

      what does this produce?
      my $a = $service->browseByIp($ipAddr);
      print @a;

      If you do need to get the som object then I think that you can get it throught the call() method,

      my $a = $service->browseByIp($ipAddr);
      my $som = $service->call(); # returns the som for the previous response

      Regards
      Duncan
    Your message has been successfully submitted and would be delivered to recipients shortly.