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

Deserializing SOAP requests with multiple Arrays

Expand Messages
  • Crispin Flowerday
    Hi, I ve run into what I think is another but with SOAP::Lite 0.65_5: There seems to some problems deserializing requests that contain multiple arguments which
    Message 1 of 1 , May 26, 2005
    • 0 Attachment
      Hi,

      I've run into what I think is another but with SOAP::Lite 0.65_5: There
      seems to some problems deserializing requests that contain multiple
      arguments which are both arrays, e.g:

      <?xml version="1.0" encoding="UTF-8"?>
      <soap:Envelope
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
      xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
      xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
      <soap:Body>
      <namesp1:hello xmlns:namesp1="Test">
      <soapenc:Array soapenc:arrayType="xsd:string[2]" xsi:type="soapenc:Array">
      <item xsi:type="xsd:string">foo</item>
      <item xsi:type="xsd:string">bar</item>
      </soapenc:Array>

      <soapenc:Array soapenc:arrayType="xsd:string[2]" xsi:type="soapenc:Array">
      <item xsi:type="xsd:string">baz</item>
      <item xsi:type="xsd:string">wibble</item>
      </soapenc:Array>
      </namesp1:hello>
      </soap:Body>
      </soap:Envelope>

      Using a simple client / daemon (attached) I can print out both arguments
      to the 'hello' function, what I get is:

      Argument 1: foo bar ARRAY(0x86ebe04)
      Argument 2: baz wibble

      What I expect is:
      Argument 1: foo bar
      Argument 2: baz wibble

      That ARRAY(..) is actually the reference for the second argument, if I
      use Data::Dumper on argument 1, you get:

      $arg1 = [
      'foo',
      'bar',
      [
      'baz',
      'wibble'
      ]
      ];

      This doesn't look right [tm] to me :-)

      This behaviour seems to come from the decode_value function in the
      Deserializer. There is a new block of code, just below the line that
      reads "Patch code introduced in 0.65 - deserializes array properly", if
      I just put 'next' in the foreach loop after the decode_object call, I
      get what I expect for arguments, but clearly that code is trying to do
      something, I just don't understand it :-)

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