Hello Pengfei,
it would be better if you shared your code, this way I'm not really sure
what are you trying to achieve.
What you mean by different types? media types? If so, you can specify
this when creating a request:
Client c = Client.create();
WebResource r = c.resoutce("
http://somehost/");
ClientResponse cr =
r.accept(MediaType.APPLICATION_XML_TYPE).get(ClientResponse.class);
And now, you can get entity (for example like string):
cr.getEntity(String.class);
if you don't know which type you should request here (your resource can
return various types as a response to same request) then it is bad
design and you should consider some refactoring.
Let me know if you have any other questions and please provide more
details next time.
Regards,
Pavel
On 3/18/11 9:54 AM, Pengfei Di wrote:
> Hello,
>
> I am trying to use ClientResponse to GET some Entity from Server.
> However, the Entity has different types. I am not sure how to solve
> the problem.
> I am following the user guide, and in chapter 3.5.3 it is written that
> the EntityTag can be used. But how should I set the Tag? Just set the
> class name inside it?
> Or, would it be better to write an own |Unmarshaller|?
>
> Thanks for any hints
>
> Pengfei