File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Web Services and the fly likes Problem with Vector Deserialization Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "Problem with Vector Deserialization" Watch "Problem with Vector Deserialization" New topic

Problem with Vector Deserialization

Venkatesh Krishnappa

Joined: May 26, 2003
Posts: 16
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="" 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=""/>
<beanMapping languageSpecificType="java:com.webservices.LoginData" qname="ns2:LoginData"
<beanMapping languageSpecificType="java:com.webservices.MercuryMsg" qname="ns3:MercuryMs
g" xmlns:ns3=""/>

The client registers the Vector serializer as follows:
qName = new javax.xml.namespace.QName("", "Vector");
cls = java.util.Vector.class;
java.lang.Class vectsf = org.apache.axis.encoding.ser.VectorSerializerFactory.class;
java.lang.Class vectdf = org.apache.axis.encoding.ser.VectorDeserializerFactory.class;

and my wsdl generated by Java2WSDL looks like this :
<schema xmlns="" targetNamespace="">
<import namespace=""/>
<complexType name="LoginData">
<element name="entitlements" nillable="true" type="impl:MercuryMsg"/>
<element name="settings" nillable="true" type="impl:MercuryMsg"/>
<element name="profile" nillable="true" type="impl:MercuryMsg"/>
<complexType name="MercuryMsg">
<element name="fields" nillable="true" type="apachesoap:Vector"/>
<element name="LoginData" nillable="true" type="impl:LoginData"/>
<schema xmlns="" targetNamespace="">
<import namespace=""/>
<complexType name="Vector">
<element name="item" minOccurs="0" maxOccurs="unbounded" type="xsd:anyType"/>

when I run my client, Iam getting this following error:
org.apache.jasper.JasperException: ; nested exception is:
org.xml.sax.SAXException: No deserializer for {}anyType
at org.apache.jasper.servlet.JspServletWrapper.service(
at org.apache.jasper.servlet.JspServlet.serviceJspFile(
at org.apache.jasper.servlet.JspServlet.service(
at javax.servlet.http.HttpServlet.service(

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.
Venkatesh Krishnappa

Joined: May 26, 2003
Posts: 16
I could fix this problem. The problem was, typemapping was missing for the object MercuryMsgField, which was a member variable in MercuryMsg. Since the Vector contained MercuryMsg elements, I had to add typemapping for MercuryMsg and the objects it contained (nesting).

I agree. Here's the link:
subject: Problem with Vector Deserialization
It's not a secret anymore!