posted 20 years ago
I have a deserialization issue here:
Let me explain what Iam doing here ... I have axis 1.1 RC1 on both server and client ends.
My web service is returning a bean Object of type LoginData.
LoginData has three member variables of type MercuryMsg (which is again a bean).
MercuryMsg has a member variable of type java.util.Vector.
My server_config.wsdd has a typemapping as defined here:
<typeMapping encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" serializer="org.apache.axis.encoding.ser.Vector
SerializerFactory" deserializer="org.apache.axis.encoding.ser.VectorDeserializerFactory" type="java:java.util.Vector" q
name="ns1:Vector" xmlns:ns1="http://java.sun.com/jax-rpc-ri/internal"/>
<beanMapping languageSpecificType="java:com.webservices.LoginData" qname="ns2:LoginData"
xmlns:ns2="http://webservices.com"/>
<beanMapping languageSpecificType="java:com.webservices.MercuryMsg" qname="ns3:MercuryMs
g" xmlns:ns3="http://webservices.com"/>
The client registers the Vector serializer as follows:
qName = new javax.xml.namespace.QName("http://java.sun.com/jax-rpc-ri/internal", "Vector");
cachedSerQNames.add(qName);
cls = java.util.Vector.class;
cachedSerClasses.add(cls);
java.lang.Class vectsf = org.apache.axis.encoding.ser.VectorSerializerFactory.class;
java.lang.Class vectdf = org.apache.axis.encoding.ser.VectorDeserializerFactory.class;
cachedSerFactories.add(vectsf);
cachedDeserFactories.add(vectdf);
and my wsdl generated by Java2WSDL looks like this :
<wsdl:types>
<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://webservices.com">
<import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
<complexType name="LoginData">
<sequence>
<element name="entitlements" nillable="true" type="impl:MercuryMsg"/>
<element name="settings" nillable="true" type="impl:MercuryMsg"/>
<element name="profile" nillable="true" type="impl:MercuryMsg"/>
</sequence>
</complexType>
<complexType name="MercuryMsg">
<sequence>
<element name="fields" nillable="true" type="apachesoap:Vector"/>
</sequence>
</complexType>
<element name="LoginData" nillable="true" type="impl:LoginData"/>
</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="Vector">
<sequence>
<element name="item" minOccurs="0" maxOccurs="unbounded" type="xsd:anyType"/>
</sequence>
</complexType>
</schema>
</wsdl:types>
when I run my client, Iam getting this following error:
org.apache.jasper.JasperException: ; nested exception is:
org.xml.sax.SAXException: No deserializer for {http://www.w3.org/2001/XMLSchema}anyType
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:254)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
.............
when my web service returns a Vector directly, then the above configuration works fine. But it fails when a Vector is
contained by another object like MercuryMsg.
Any help will be greatly appreciated.
thanks,
-venky