cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From DmitryM <nskmda_fors...@mail.ru>
Subject Re: Unmarshal WebApplicationException Response JSON entity
Date Tue, 02 Mar 2010 17:37:32 GMT

Sergey, thanks a lot for your response.


Sergey Beryozkin-5 wrote:
> 
> I guess what you really would like to do is to write some simple
> Jettison-specific code to be used inside of your exception mapper which
> will
> use a statically allocated JAXBContext (for your exception data bean) to
> get
> an Unmarshaller and then use it to read from a basic XMLStreamReader
> created
> by Jettison, please have a look at JSOnProvider.readFrom, 2/3 lines of
> code
> can be found there showing how to create a basic JSON-aware reader
> 

I took a look into the JSONProvider source code.
To me it doesn't really look as a 2-3 lines of code.
There is actually a whole bunch of methods to create context, unmarshaller
(it's inherited from the AbstractJaxbProvider), then create xml stream
reader and so on and on and on.
If I go this way my code would not be as simple as it's now.

I guess, I will stick to 1-line JSONProvider call (though ugly but not
really making me copy-paste the CXF code which is already available via that
readFrom call).

Anyway, thank a lot for all the help.
It was really useful.

Dmitry
-- 
View this message in context: http://old.nabble.com/Unmarshal-WebApplicationException-Response-JSON-entity-tp27726278p27758769.html
Sent from the cxf-user mailing list archive at Nabble.com.


Mime
View raw message