I have a service exposed via JAX-WS and Spring with CXF 2.1.3.  Some
of the methods in the service interface return either an Address
object or a Customer object which has a property of type Address
(public Address getAddress).  Further, Address has two subclasses,
BusinessAddress and ResidentialAddress, and any instance is always one
or the other of those subclasses.  And the Address class is annotated
with @XmlSeeAlso({BusinessAddress.class,ResidentialAddress.class})

Now when I call the service method like this:

public List<Address> getAllAddresses

Then I get what I expect -- the SOAP client receives every entry as
either a BusinessAddress or ResidentialAddress.

But when I call the service method like this:

public List<Customer> getAllCustomers

Then there's a problem.  Every customer's address comes through in the
SOAP (verified with a log interceptor) as just a plain Address, not
one of the subclasses.  If I call the method directly in the same VM,
I get the subclasses.  So it seems to be a problem with the encoding
of the SOAP return types, not a problem with what the service returns.

Any ideas?

Thanks,
       Aaron

Reply via email to