Hi there!
I wonder how I would go about mapping different implementations of an
interface depending on wether it is used as incoming parameter or return
value.
Here's the story:
I have a class, Partner, containing a lot of attributes. I want to be able
to return a subset of the attributes from a SOAP call. So my idea was to
create an interface, say WebPartner, containing getters for the attributes I
want to expose and let Partner implement that interface. Then I would have a
SOAP enabled method:
WebPartner getPartner(String id) {
// Find partner
return partner;
}
and a mapping
<beanMapping languageSpecificType="java:mypackage.WebPartner"
qname="ns1:WebPartner" xmlns:ns1="urn:WebShop"/>
Now, I also want the SOAP client to be able to update the attributes of my
Partner, but only the attributes exposed (the subset).
I want a method
void updatePartner(WebPartner webPartner {
// Find partner
// Update values
}
The idea here was to create another class, say WebPartnerImpl, that has only
the exposed subset of attributes. But how would I map WebPartner to become
WebPartnerImpl then?
(An alternative is of course to map WebPartnerImpl and then copy all the
relevant values from Partner to a WebPartnerImpl before returning the
infomation, but I would like to avoid that)
Mattias Jiderhamn
Expert Systems
[EMAIL PROTECTED]
www.expertsystem.se