I think ResponseReader, recently introduced in CXF 2.3.1, is your friend.

If you go to the Talend Service Factory (CXF wrap) Examples[1], under examples/jaxrs-advanced/client/..../RESTClient.java, method useSimpleProxy() has it.

Glen

[1] http://www.talend.com/resources/documentation.php#SF

On 20.01.2011 22:11, Dan King wrote:
Hi all,

Up until now I've had the web client return the desired java object rather then
a Response object, i.e. Object target =
client.type("application/json").accept("application/json").get(Target.class)

But now I want to check the response and then get the entity/message body, but
I'm stuck on how to convert the response input stream -- Response.getEntity() --
into the desired java object.

I'm using all default settings, all the DTO classes use jaxb annotations
(@XmlRootElement), and the message body is in json format. Does anyone know how
to do the conversion/unmarshalling? Can anyone point me to some examples?


Thanks.

-Dan






--
Glen Mazza
Software Engineer, Talend (http://www.talend.com)
blog: http://www.jroller.com/gmazza


Reply via email to