Can you send me a pointer to some examples?
@Path("/")
class WebStore {
@POST
@Path("/customers/")
Response addCustomer(@XmlJavaTypeAdapter(CustomerImplAdapter.class)
Customer c) {
...
}
}
public class CustomerImplAdapter extends XmlAdapter<CustomerImpl,
Customer> {
@Override
public Customer unmarshal(CustomerImpl v) throws Exception {
return v;
}
@Override
public CustomerImpl marshal(Customer v) throws Exception {
return (CustomerImpl) v;
}
}
... and annotate CustomerImpl with @XmlRootElement
Alternatively, instead of adding
@XmlJavaTypeAdapter(CustomerImplAdapter.class) to the parameter, you can
add it to Customer inteface directly.
Cheers,
Joerg