I guess you could use the builtin bean (de)serializer, that is, tha
beanmapping tag in the deploy.wsdd file.

Theoretically you will be able to serialize all the public members of your
types and you don't have to write custom (de)serializers. I have been
experiencing with the same issue the last few days, and for me it works,
true, I tried it with a quite simplistic scenario. I don't know how your
types look like, though. The only problem I encountered so far was that if I
had a type X wich had a member array of Y objects, then it didn't work
unless a wrote a getter/setter method pair for the Y[] member.

Here is the letter I sent on this mailing list a few days ago, nobody really
replied to it until now:

Hi,

allegedly AXIS 1.0rc can handle the (de)serialization of custom objects with
the builtin bean (de)serializer classes (beanmapping tag in the WSDD), and
these custom objects don't necessarily need to have getter/setter methods
anymore, it's enough for the (serializable) members to be declared public.

I tried it out, and it looks like it works, only to a certain point though:
when the custom object contains a public member which is an array of another
custom object. Then AXIS can handle the (de)serialization of the big object
only if I write, like before, a custom (de)serializer class for it (and I
have a typemapping tag in the deploy.wsdd file for the big object). If I use
the beanmapping tag for it, then I get the following error messages (lets
say the big class is called X, the little one Y, so X contains an array of
Ys, which is called y_array):

    java.lang.IllegalArgument Exception: array element type mismatch
    Could not convert [LY; to bean field y_array[0], type Y


I don't know where that [L in front of the class name comes from, maybe the
problem is related to that...
I have checked the SOAP message AXIS gets from the client, and I haven't
seen anything unusual in it. When I comment out the beanmapping tag and
uncover the typemapping tag for the X (yes, X, not Y, Y has a beanmapping
tag) class in the WSDD (which points to the custom (de)serializer classes),
and I redeploy the web service, then it works again.

Has anybody encountered this problem? Any suggestions?

Thanks.
----- Original Message -----
From: "Deepth Dinesan" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, September 18, 2002 11:15 AM
Subject: Serializer/Deserializer


> Hi all,
>
> I have some (about 25)  user defined types that I need to serialize .
> These classses
> are fairly complex making use of  inheritance and aggregation
> extensively .
> Is there a way by which I can avoid writing serializers/deserializers
> and still be able to serialize .
>
> Eg:
>
> (1) I may use the ObjectStreamFields and the transient keyword to find
> which fields needs to be serialized  !!
> (2) I can have a java2schema generator. and then I may defines a map
> file which axis may use to serialize/deserialize . In fact this approach
> is being used by MindElectric in thei GLUE product . Pretty Clean way !!
>
> ThanX
> Deepth
>
>
> --
> "You have Brains in Your Head,You have feet in your Shoes"
> "You can steer yourself any direction you choose"
>
>

Reply via email to