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

accessing multiple results by name

Expand Messages
  • John Gateley
    A simple question, but I can t find the answer on www.soaplite.com I have a SOAP method that returns multiple results: sub Foo { my $Self = shift; my
    Message 1 of 1 , Aug 7 9:06 AM
    • 0 Attachment
      A simple question, but I can't find the answer on
      www.soaplite.com

      I have a SOAP method that returns multiple results:


      sub Foo {
      my $Self = shift;
      my $InParameter = SOAP::Server::Parameters::byName(['xxx'], @_);

      ...

      return (SOAP::Data->name('Name' => "Ralph")->type("string"),
      SOAP::Data->name('Address' => "123 Happy Lane)->type("string"));
      }

      On the client, how can I access these results by name? (The equivalent
      of SOAP::Server::Parameters::byName for input parameters).


      my $SOAPResult = SOAP::Lite
      -> uri('...')
      -> proxy(...)
      -> Foo(SOAP::Data->name('xxx' => 'Something'));

      if($SOAPResult->fault) {
      print "There was a fault: ", $SOAPResult->faultcode, " ", $SOAPResult->faultstring, "\n";
      } else {
      my @ResultList = $SOAPResult->paramsout;
      my $Result = $SOAPResult->result;

      print "Done, result <$Result>\n";
      print "parameters: <", join('><', @ResultList), ">\n";
      }

      I want to say something like:
      my ($Name, Address) = SOAP::Results::byName(['Name', 'Address'], @ResultList);

      Thanks very much, if this is documented somewhere, please point me there.

      j
      --
      John Gateley <tiger@...>
    Your message has been successfully submitted and would be delivered to recipients shortly.