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

XML with references won't work (bug?)

Expand Messages
  • calinm
    Hello, I have a Sun WSDP server and a SOAP::Lite Client. $A = SOAP::Data- new()- type( Bean1 )- value({m1 = FOO , m2 = 22}); $B =
    Message 1 of 2 , Aug 24, 2002
    • 0 Attachment
      Hello,

      I have a Sun WSDP server and a SOAP::Lite Client.

      $A = SOAP::Data->new()->type('Bean1')->value({m1 => "FOO", m2 => 22});
      $B = SOAP::Data->new()->type('Bean1')->value({m1 => "FOO", m2 => 22});
      $arraythatworks = SOAP::Data->new()->value([$A,$B]);

      $arraythatworks is an array that works and parses correctly on my
      java server.

      However:
      $brokenarray = SOAP::Data->new()->value([$A,$A]);

      Will not work. The serializer will try to serialize $A only once and
      use references to it, but will produce the following bad XML.

      <SOAP-ENV:Body>
      <namesp1:echoArray xmlns:namesp1="http://com.test/wsdl/ZoneEditWS">
      <arrayOfBean1_1 SOAP-ENC:arrayType="namesp2:Bean1[2]"
      xsi:type="SOAP-ENC:Array">
      <item href="#ref-137042196" xsi:type="namesp2:Bean1"/>
      <item href="#ref-137042196" xsi:type="namesp2:Bean1"/>
      </arrayOfBean1_1></namesp1:echoArray>
      <item id="ref-137042196" xsi:type="namesp2:Bean1">
      <m2 xsi:type="xsd:int">22</m2>
      <m1 xsi:type="xsd:string">FOO</m1>
      </item>
      <c-gensym3 href="#ref-137042196" xsi:type="namesp3:SOAPStruct"/>
      </SOAP-ENV:Body>

      Which throws this fault:

      <env:Body><env:Fault><faultcode>env:Server</faultcode><faultstring>Int
      ernal Server Error (deserialization error: trailing block elements
      must have an id attribute)</faultstring></env:Fault></env:Body>
    • Duncan Cameron
      ... Not sure what the final element is doing there. Looks like a bug. Use multirefinplace to make SOAP::Lite put the value on the first occurence.
      Message 2 of 2 , Aug 24, 2002
      • 0 Attachment
        On 2002-08-24 calinm wrote:
        >Hello,
        >
        >I have a Sun WSDP server and a SOAP::Lite Client.
        >
        >$A = SOAP::Data->new()->type('Bean1')->value({m1 => "FOO", m2 => 22});
        >$B = SOAP::Data->new()->type('Bean1')->value({m1 => "FOO", m2 => 22});
        >$arraythatworks = SOAP::Data->new()->value([$A,$B]);
        >
        >$arraythatworks is an array that works and parses correctly on my
        >java server.
        >
        >However:
        >$brokenarray = SOAP::Data->new()->value([$A,$A]);
        >
        >Will not work. The serializer will try to serialize $A only once and
        >use references to it, but will produce the following bad XML.

        ><SOAP-ENV:Body>
        ><namesp1:echoArray xmlns:namesp1="http://com.test/wsdl/ZoneEditWS">
        ><arrayOfBean1_1 SOAP-ENC:arrayType="namesp2:Bean1[2]"
        >xsi:type="SOAP-ENC:Array">
        ><item href="#ref-137042196" xsi:type="namesp2:Bean1"/>
        ><item href="#ref-137042196" xsi:type="namesp2:Bean1"/>
        ></arrayOfBean1_1></namesp1:echoArray>
        ><item id="ref-137042196" xsi:type="namesp2:Bean1">
        ><m2 xsi:type="xsd:int">22</m2>
        ><m1 xsi:type="xsd:string">FOO</m1>
        ></item>
        ><c-gensym3 href="#ref-137042196" xsi:type="namesp3:SOAPStruct"/>
        ></SOAP-ENV:Body>
        >
        >Which throws this fault:
        >
        ><env:Body><env:Fault><faultcode>env:Server</faultcode><faultstring>Int
        >ernal Server Error (deserialization error: trailing block elements
        >must have an id attribute)</faultstring></env:Fault></env:Body>
        >
        Not sure what the final <c-gensym3> element is doing there. Looks
        like a bug.

        Use multirefinplace to make SOAP::Lite put the value on the first
        occurence.

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