Sorry, will copy this to the JIRA :-)

thanks, Sergey
On 01/02/17 16:35, Sergey Beryozkin wrote:
The question is, given a custom bean, like MyDocument (which may have
some properties), how to intercept the JSON serialization process, so
that the signature can be calculated on the flight and the payload be
augmented with the @signature property.

If MyDocument has JAXB annotations and depends on a JAXB XML to JSON
conversions then perhaps we can register a JCS XMLStreamWriter (and
XMLStreamReader on the read side) which is possible for ex with CXF
JSONProvider (Jettison based).

If Jackson allows to intercept the serialization process then perhaps it
is possible to use Jackson.

May be the simplest option to start, for POC, is to have CXF filters
caching the stream, and then reading it, adding or validating the
signature, and then letting the request flow.


--
Sergey Beryozkin

Talend Community Coders
http://coders.talend.com/

Reply via email to