• Post Reply Bookmark Topic Watch Topic
  • New Topic

what should be the serializer for this ?

 
ranjiith s
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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/
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!