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

1743Sending complex Hashes to Java-Soap client

Expand Messages
  • tmangner
    Aug 11 1:48 PM
    • 0 Attachment
      Hi,

      can anyone tell me, how to send this hash to java-soap client? the
      hash-values can be: scalar, array or hash:
      RESULT: ='HASH(0x1f7c080)'
      'catalogs'=>'ARRAY(0x1f74558)'
      '1234'
      '0815'
      '4321'
      'manufacturer'=>'Toast Inc.'
      'productname'=>'Toaster'
      'variations'=>'ARRAY(0x1f79b84)'
      'HASH(0x1f78188)'
      'color'=>'chrome
      'price'=>'24.95'
      'HASH(0x1f7615c)'
      'color'=>'blue'
      'price'=>'21.95'

      my %hash = ('productname' => 'Toaster',
      'manufacturer' => 'Toast Inc.',
      'catalogs' => ['1234', '0815', '4321'],
      'variations' => [{'color' => 'chrome',
      'price' => '24.95'},
      {'color' => 'blue',
      'price'=> '21.95'}]);


      i used the ->xmlschema('2001') construct, but that doesn't help.

      when is used this:
      return SOAP::Data->type(map => $catalogInfo)->name('result');
      i get this error from the java-soap client:
      "No mapping found for 'http://xml.apache.org/xml-soap:SOAPStruct'
      using encoding style 'http://schemas.xmlsoap.org/soap/encoding/'."
      (simple hashes work perfectly with this method)

      duncan gave me a hint, so i was going to redefine SOAP::Lite's
      internal method for hash serialisation:
      *SOAP::Serializer::encode_hash = \&SOAP::Serializer::as_map;
      now i get this:
      Fault Code: SOAP-ENV:Client
      Fault String: Element '' can't be allowed in valid XML message. Died

      i dont know, what to do now ... can anyone try to send this little
      example hash to java? this can't be that difficult. Sending arrays
      works fine, sending hashes works fine ... so sending hashes with
      arrays can't be such a challenge.