users@jersey.java.net

[Jersey] Multiple return type with Jersey and JaxB

From: <stephane.jeanjean_at_orange-ftgroup.com>
Date: Mon, 6 Dec 2010 18:11:42 +0100

Hi,
 
I'm using Jersey as Client API to call REST Services. I'm using JaxB entities to get the responses.
The services return a different entity if there is an error. So I have to 2 JaxB classes with an @XmlRootElement : one for my business class and one for the error. But I don't know how to use 2 classes with Jersey Client API :(
 
Do you have an idea to manage this kind of REST call, please ?
 
I found this topic which is exactly my issue : http://stackoverflow.com/questions/2025997/multiple-return-type-in-jersey-client-request
But I can't change the REST service as proposed in the answer, it's not mine.
 
Thanks,
 
Stéphane