> Hi, > > This is a more or less well known problem or feature in Soap2.2 a > specialized class will be serialized as the superclass which your server > code returns and not as the spesialized class which it was constructed as. > To get around this you'll either have to change to bean serializer code or > possible solve this by writing your own serializer. question: Does axis solve this "behaviour" ?
my opinion about this behaviour: This might be the reason why they have implemented it this way : I might have the A class properly mapped (deployed) but the B class might not be deployed (don't provide the information from deploymentDescriptor). So the apache soap does not check if B is mapped and instead it simply cast the returned object to the class found in the method signarure and serialize it. >From my viewPoint i think it would have been more realistic if implementing this check: if B registered then return a B object else the superclass registered. But I am not the one who has written the code so this might cause another problems in design. As I have already said : a philosophical problem ;o) > > Ronny > > -----Original Message----- > From: dovle [mailto:[EMAIL PROTECTED]] > Sent: 21. mars 2002 13:59 > To: [EMAIL PROTECTED] > Subject: Re: Simple question > > Answer inline : > > Hi, > > > > Isn't this a question for a Beans forum, like the one on > > http://forum.java.sun.com/forum.jsp?forum=39 > > nope. Why do you think this ? > > My 'problem' is that I really return a B object but the apache soap sees it > as a A class (only an A object) because of the method signature. It does > not > > care if this is a B class. It serialize an A class (encoding for A, attribs > of A, no params from B, no encoding from B) . > > I was 'dazzled' because, if using only java (no soap no nada) then calling > methd( param ) will give me a B object but only casted to an A object. So > result.getClass() will be B instead of A . > > HOpe I made miself clear... am I ? :o))) > > Don't misunderstand me, it is not a real problem, I was only puzzled with > this behaviour. And I was asking for some philosophical answer. > > > Michel > > > > -----Original Message----- > > From: dovle [mailto:[EMAIL PROTECTED]] > > Sent: donderdag 21 maart 2002 13:48 > > To: '[EMAIL PROTECTED]' > > Subject: Simple question > > > > > > Hi all, > > My situation > > > > Class A (bean) > > Class B (bean too) extends A > > > > A method( params ) > > { > > return new B() ; > > } > > > > The encoding is for the A class. Is this thing correct ? Why ? (supposing > > I > > > have registered also the B class) > > > > thanks > > dovle