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 Scott Ellsworth <sc...@alodar.com> on 2003/12/13 01:00:40 UTC
How do I tell Axis to deserilize an xml-soapSOAPStruct in stubs?
Howdy, all.
I have read through the responses to my last post, and tried various
experiments, but I think I am just missing something. Here is a more
specific, and thus hopefully easier question that might illuminate what
I am missing.
I am trying to deserialize the following return from my
SOAP::Lite-based server using axis-generated stub classes, and it is
complaining that it cannot deserialize the SOAPStruct being returned.
I have tried to provide one, and I am not sure why it is not being
found:
<s-gensym3 xsi:type="namesp2:SOAPStruct">
<admin xsi:type="xsd:int">
1
</admin>
<guest xsi:type="xsd:int">
2
</guest>
</s-gensym3>
In the envelope, they defined namesp2 as
xmlns:namesp2="http://xml.apache.org/xml-soap", thus I better define
what to do with an xml.apache.org/xml-soapSOAPStruct. I also need to
tell it how to interpret the names and values.
I do this with the following <types> element - one defining my map, one
defining the entries in the map, and one to tell it how to handle an
xml-soap SOAPStruct:
<types>
<schema
xmlns="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://feature.alodar.com/Alodar/GBIB/"
>
<import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
<complexType name="mapItem">
<sequence>
<element name="key" nillable="true" type="string" />
<element name="value" nillable="true" type="string" />
</sequence>
</complexType>
<complexType name="Map">
<sequence>
<element maxOccurs="unbounded" minOccurs="0" name="item"
type="tns:mapItem" />
</sequence>
</complexType>
</schema>
<schema
xmlns="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://xml.apache.org/xml-soap"
>
<import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
<complexType name="SOAPStruct">
<all>
<element name="Map" type="tns:Map"/>
</all>
</complexType>
</schema>
</types>
This should have defined what to do with an
{xml.apache.org/xml-soap}SOAPStruct, as well as the Map and MapItems it
contains.
When I run this, I get the error
[java] Error: org.xml.sax.SAXException: Deserializing parameter
's-gensym48': could not find deserializer for type
{http://xml.apache.org/xml-soap}SOAPStruct
This confuses me, though, because my WSDL contains a SOAPStruct def, as
well as the map and map item I would have expected to have used.
For completeness, here are the messages and operations.
<message name="idNameMapResponse">
<part name="idNameMapReturnValue" type="tns:Map" />
</message>
<operation name="get_user_ids_by_name">
<input message="tns:config_nameRequest" />
<output message="tns:idNameMapResponse" />
</operation>