You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Paul Andrews <pa...@cisco.com> on 2003/03/04 21:55:35 UTC

Question about bean properties

I have beans whose properties are themselves beans, but I have a problem
that the bean serializer just looks at the type of the properties rather
than at the type of the properties' values - some of those values are
sub-classes of the property type.

E.g.:

Public class base {
	public int getAnInt() { ... }
}

Public class sub extends base {
	public String getAString() { ... }
}

Public class bean1 {
	base thing = new sub();

	public base getThing() { return thing; }
}

Will only encode the attributes in the base class, not the derived
class. Shouldn't it encode the derived class attributes too?


RE: Question about bean properties

Posted by Paul Andrews <pa...@cisco.com>.
Here I go again. Mea Culpa - I forgot to define the derived type in the
WSDD file.

> -----Original Message-----
> From: Paul Andrews [mailto:paandrew@cisco.com] 
> Sent: Tuesday, March 04, 2003 3:56 PM
> To: axis-user@ws.apache.org
> Subject: Question about bean properties
> 
> 
> I have beans whose properties are themselves beans, but I 
> have a problem
> that the bean serializer just looks at the type of the 
> properties rather
> than at the type of the properties' values - some of those values are
> sub-classes of the property type.
> 
> E.g.:
> 
> Public class base {
> 	public int getAnInt() { ... }
> }
> 
> Public class sub extends base {
> 	public String getAString() { ... }
> }
> 
> Public class bean1 {
> 	base thing = new sub();
> 
> 	public base getThing() { return thing; }
> }
> 
> Will only encode the attributes in the base class, not the derived
> class. Shouldn't it encode the derived class attributes too?
>