cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sergey Beryozkin <sberyoz...@gmail.com>
Subject Re: Missing ResponseReader in CXF >= 2.7.0
Date Thu, 21 Mar 2013 21:50:58 GMT
Hi
On 21/03/13 21:30, Daniel Bimschas wrote:
> Hi there!
>
> I'm currently trying to work with the CXF client API and the nice proxy feature it provides.
Now, one of my API methods returns a javax.ws.rs.core.Response wrapping an entity. This entity
is a JAXB annotated class which is serialized to JSON and shall be deserialized on client
side. Now, when I execute the client I get the following error message:
>
>    java.lang.ClassCastException: sun.net.www.protocol.http.HttpURLConnection$HttpInputStream
cannot be cast to MyDtoClass
>
> According to [1] one can use the ResponseReader class such that the stream will be deserialized
to the expected type. However, it seems that starting with CXF 2.7.0 (I'm using 2.7.3) this
class is missing. Can you enlighten me here?
>
I'm really late on updating the documentation on the JAX-RS 2.0 
features, the 2.0 implementation work is still ongoing,

The following will work:

MyClass myclass = myResponse.readEntity(MyClass.class)

Cheers, Sergey

> Cheers,
> Daniel
>
> [1] http://cxf.apache.org/docs/jax-rs-client-api.html#JAX-RSClientAPI-Limitations

Mime
View raw message