Hi

please see comments inline

cheers, Sergey

On Mon, Mar 1, 2010 at 5:12 AM, DmitryM <[email protected]> wrote:

>
> Sergey, thanks a lot for the response.
>
> I'm a little confused here. I couldn't find ResponseExceptionHandler in the
> latest API doc (the link from the main CXF page).
>
> S.B : It's linked to from the page I linked to in the previous email,
here's another link :
http://svn.apache.org/repos/asf/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/ResponseExceptionMapper.java

(actually, it's not a ResponseExceptionHandler, sorry)



> Is there an example how to do that handler registration?
>
> S.B : If you're creating a proxy from the code then one of the
JAXRSClientFactory create methods will accept a list of providers. If you're
injecting a proxy using jaxrs:client then you can use
jaxrs:client/jaxrs:providers to inject a list of providers...



> Did you mean it was possible to have a generic handler for a
> WebApplicationException on the client side which could replace the
> WebApplicationException's Response's entity (which I currently see as a
> formatted JSON) with a specific Java class?
>
> > S.B : ResponseExceptionMapper would be given a chance to react when it is
HTTP 500 (and similar). If it is not available or returns null then
WebApplicationException is thrown, otherwise it can convert a Response into
whatever exception it needs, so what it can do is to convert an
(InputStream)Response.getEntity into a specific Java class using a default
JSONProvider and then 'attach' it to some exception instance,
WebApplicationException or some other one...



> Thanks,
> Dmitry
>
> Sergey Beryozkin-2 wrote:
> >
> > You said in the follow-up email that you were using a proxy on the client
> > side. So you may want to register a ResponseExceptionHandler :
> > http://cxf.apache.org/docs/jax-rs.html#JAX-RS-Handlingexceptions
> >
> > This handler may create an instance of JSONProvider and pass the
> > JSON-formatted string to it and then return the resulting instance,
> > possibly by adding it to a custom WebApplicationException
> >
> > Cheers, Sergey
> >
>
> --
> View this message in context:
> http://old.nabble.com/Unmarshal-WebApplicationException-Response-JSON-entity-tp27726278p27740239.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>
>

Reply via email to