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

Re: [soaplite] Arrays / Hashes

Expand Messages
  • Duncan Cameron
    ... With version 0.65 of S::L repeating elements should get deserialised into an array. e.g. client print $s- test2 (SOAP::Data- type( xml = result;
    Message 1 of 2 , Feb 22, 2005
    • 0 Attachment
      At 2005-02-22, 14:08:24 finalthroes <jamesmarn@...> wrote:

      >
      >
      >Hi,
      >
      >Is it correct that the only way to access arrays in a Perl SOAP::Lite
      >server is to access the soap envelope directly?
      >
      >If a request that has an array passed to the soap webservice like this:
      >
      ><searchParams>
      > <string>red</string>
      > <string>shoes</string>
      ></searchParams>
      >
      >it would get parsed into a hash, with only the last entry available in
      >that has, as both the <string> elements have the same key 'string'.
      >
      >Am I missing something?
      >
      With version 0.65 of S::L repeating elements should get deserialised into an array.

      e.g. client

      print $s->test2
      (SOAP::Data->type('xml' => <<END))->result;
      <searchParams>
      <string>red</string>
      <string>shoes</string>
      </searchParams> )
      END


      server
      ====
      sub test2 {
      my ($class, $p) = @_;
      for (@{$p->{string}}) {
      print STDERR $_;
      }
      return 'ok';
      }

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