You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Simon McClenahan <si...@stellent.com> on 2002/04/02 17:05:25 UTC
Serializing anyType
For the client, I have turned off multirefs. The schema defines some
values as type xsd:anyType, but the client serializes the type as
xsd:anyType instead of its true type. Then the server returns a fault
being unable to deserialize anyType.
e.g.
<options xsi:type="SOAP-ENC:Array"
SOAP-ENC:arrayType="ns1:Option[4]">
<item xsi:type="ns1:Option">
<name xsi:type="xsd:string">collapseWhiteSpace</name>
<value xsi:type="xsd:anyType">true</value>
</item>
<item xsi:type="ns1:Option">
<name xsi:type="xsd:string">customElement</name>
<value
xsi:type="xsd:anyType">[Lcom.foo.ws.axis.CustomElement;@1e0c13</value>
</item>
...
The workaround is to enable multirefs on the client
e.g.
<options xsi:type="SOAP-ENC:Array"
SOAP-ENC:arrayType="ns1:Option[4]">
...
<item href="#id4"/>
<item href="#id5"/>
</options>
<multiRef id="id4" SOAP-ENC:root="0" xsi:type="ns7:Option"
xmlns:ns7="xxx">
<name xsi:type="xsd:string">collapseWhiteSpace</name>
<value href="#id11"/>
</multiRef>
<multiRef id="id11" SOAP-ENC:root="0"
xsi:type="xsd:boolean">true</multiRef>
<multiRef id="id5" SOAP-ENC:root="0" xsi:type="ns4:Option"
xmlns:ns4="xxx">
<name xsi:type="xsd:string">customElement</name>
<value href="#id8"/>
</multiRef>
<multiRef id="id8" SOAP-ENC:root="0" xsi:type="SOAP-ENC:Array"
SOAP-ENC:arrayType="ns9:customElement[2]" xmlns:ns9="xxx">
<item href="#id13"/>
<item href="#id14"/>
</multiRef>
I think this is a problem with Axis not serializing the correct instance
type. Multirefs (a la Axis) are very ugly when trying to debug your SOAP
calls!
cheers,
Simon