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

cannot get array from perl soap server by Java soap client

Expand Messages
  • yuet_mei2002
    I has written a perl soap server, it it sample return an array sub testarray { my @var2; push @var2, 123 ; push @var2, efg ; push @var2, hig ; return @var2;
    Message 1 of 2 , Jun 7, 2004
    • 0 Attachment
      I has written a perl soap server, it it sample return an array

      sub testarray {
      my @var2;
      push @var2, '123';
      push @var2, 'efg';
      push @var2, 'hig';
      return @var2;
      }

      I can get the value correctly from perl soap client by using
      $result->result;
      $result->paramsout;

      but I only can get the first value 123 from org.apache.soap client
      Type = java.lang.Integer
      Value = '123'

      How can I get other value for the return array ?
    • Duncan Cameron
      ... This is actually returning three individual values, not an array. You need to return a reference to the array return @var2; ... Then your perl client can
      Message 2 of 2 , Jun 8, 2004
      • 0 Attachment
        yuet_mei2002 wrote:
        >I has written a perl soap server, it it sample return an array
        >
        >sub testarray {
        >my @var2;
        >push @var2, '123';
        >push @var2, 'efg';
        >push @var2, 'hig';
        >return @var2;
        >}
        This is actually returning three individual values, not an array.
        You need to return a reference to the array
        return \@var2;

        >I can get the value correctly from perl soap client by using
        >$result->result;
        >$result->paramsout;
        Then your perl client can access it by (I think)

        my @array = @{$result->result};

        >
        >but I only can get the first value 123 from org.apache.soap client
        >Type = java.lang.Integer
        >Value = '123'
        >
        I don't know much about the apache soap package but hopefully it will recognise the array being returned.

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