Two Laptop Bag
The moose likes Web Services and the fly likes what should be the serializer for this ? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Web Services
Reply Bookmark "what should be the serializer for this ?" Watch "what should be the serializer for this ?" New topic
Author

what should be the serializer for this ?

ranjiith s
Greenhorn

Joined: Dec 12, 2003
Posts: 8
UserCollection
{
public User[] users;
}

1) A bean mapping for 'User' is required.

2) Is a bean mapping required for UserCollection or
it should be an arraymapping ?

<arrayMapping
xmlns:ns="SecurityService"
qname="ns:UserCollection"
type="java:mypkg.User[]"
innerType="ns:User"
encodingStyle=""
/>

If I use the above the client fails with

Caused by: java.io.IOException: No serializer found for class mypkg.UserCollection in registry org.apache.axis.encoding.TypeMappingDelegate@102a0a5
at org.apache.axis.encoding.SerializationContext.serializeActual(SerializationContext.java:1429)
at org.apache.axis.encoding.SerializationContext.serialize(SerializationContext.java:914)
at org.apache.axis.encoding.SerializationContext.outputMultiRefs(SerializationContext.java:989)
at org.apache.axis.message.SOAPBody.outputImpl(SOAPBody.java:145)
at org.apache.axis.message.SOAPEnvelope.outputImpl(SOAPEnvelope.java:477)
at org.apache.axis.message.MessageElement.output(MessageElement.java:1208)
at org.apache.axis.SOAPPart.writeTo(SOAPPart.java:315)
... 33 more


The following bean mapping works if I have the indexed set and get methods in the UserCollection object.
Viz. set(int i, User user) and getUser(int i) if present in UserCollection the following works. But would like to know what is wrong with the Array mapping or am I missing something ?

<typeMapping
xmlns:ns="SecurityService"
qname="ns:UserCollection"
type="java:mypkg.CSUserCollection"
serializer="org.apache.axis.encoding.ser.BeanSerializerFactory"
deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory"
encodingStyle=""
/>

Thankx in advance
ranjiith s
Balaji Loganathan
author and deputy
Bartender

Joined: Jul 13, 2001
Posts: 3150
You have to specify mapping for usercollection, user and user[].
if you are using rpc style, then u cna set the encodingstyle to http://schemas.xmlsoap.org/soap/encoding/
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: what should be the serializer for this ?
 
Similar Threads
deploy.wsdd >> symbols Axis engine
Apache axis
Axis + CGLIB = BeanSerializerFactory problems
axis - array inside a bean deserialization
Serializers/Deserializers for custom complex Java objects