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

2450Sending array of arrays between SOAP::Lite and Java

Expand Messages
  • dfg778
    Mar 10, 2003
    • 0 Attachment
      I'm having a lot of difficulty sending an array of arrays between a
      SOAP::Lite server and a Java (Apache SOAP) client. My client has the

      sub getLoL {

      my @LoL = ( [qw(a b c d)], [qw(d e f g)]) ;
      my @SOAPLoL ;
      foreach $row (@LoL) {
      my (@SOAProw, $i) ;
      foreach $col (@{$row}) {
      $col = SOAP::Data->name("col".++$i)->type('string')->value
      ($col) ;
      push @SOAProw,$col ;
      push @SOAPLoL,SOAP::Data->name("row")->type('Hashtable')->value
      (\@SOAProw) ;
      my $output = SOAP::Data->name('LoL')->type('Vector')->value
      (\@SOAPLoL) ;
      #my $output = SOAP::Data->name('LoL' => \@LoL)->type ;
      #my $output = \@LoL ;
      return $output ;

      I've been through several iterations of this, having to get more and
      more specific every time. If I just return the reference to the
      array, the Java client gives me:

      Unable to resolve namespace URI for '~C'

      (it's complaining about an array type specification of ~C:Array in
      the Soap packet, the appropriate fragment is below)

      <SOAP-ENV:Body><namesp2:getLoLResponse xmlns:namesp2="urn:Demo"><SOAP-
      ENC:Array SOAP-ENC:arrayType="~C:Array[2]" xsi:type="SOAP-
      ENC:Array"><s-gensym9 SOAP-ENC:arrayType="xsd:string[4]"<s-gensym9
      SOAP-ENC:arrayType="xsd:string[4]" xsi:type="SOAP-ENC:Array"><col1 xs
      i:type="xsd:string">a</col1><col2 xsi:type="xsd:string">b</col2><col3

      (Is the inclusion of the ~C a bug, or is this some part of the SOAP
      spec I haven't seen ?)

      If I return the array fully qualified with Java types (and provide
      the appropriate mappings in the client), I end up with the following
      error from the Java client:

      Unable to retrieve PropertyDescriptor for property 'col1' of
      class 'class java.util.Hashtable'.

      I may be going about this in completely the wrong way, but if anybody
      would be able to point me in the right direction it would be much
    • Show all 2 messages in this topic