You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Sharif Ghazzawi <sh...@resonate.com> on 2015/10/30 16:31:28 UTC

Jso-api/Katharsis.io

All,


I currently have an Apache CXF application into which I am trying to integrate this library http://katharsis.io/ for the purposes of serializing objects into json-api compliant payloads.



The documentation here http://katharsis.io/#jax-rs states that it can be integrated with jax-rs environments by registering an implementation of javax.ws.rs.Feature with the jax-rs environment.


I have been reading through the Apache CXF documentation and have not been able to find anything explaining how to register an instance of javax.ws.rs.Feature.


Does anyone have any insights as to how this can be accomplished?


Thank you,


Sharif Ghazzawi



Re: Jso-api/Katharsis.io

Posted by Sergey Beryozkin <sb...@gmail.com>.
Features are now recognized directly on the server side too

(is expected to work starting from CXF 3.1.7)

Thanks, Sergey
On 30/10/15 15:59, Sergey Beryozkin wrote:
> Hmm, looks like a Feature can be directly registered with the server
> too. Apparently TCKs do not enforce that...
> It can actually be registered on the server with CXF indirectly, from
> DynamicFeature - so what you can do right now is to register a
> DynamicFeature impl that will simply set a Katharsis feature. No need to
> to it on the client side, just register it directly with 2.0 Client
>
>
> I'll look into having Features supported directly on the server time in
> meantime...
>
> Sergey
>
> On 30/10/15 15:48, Sergey Beryozkin wrote:
>> Hi
>>
>> You can register it as a JAX-RS provider, in
>> jaxrs:server/jaxrs:providers, though I'm presuming
>> you should implement
>>
>> https://jax-rs-spec.java.net/nonav/2.0-rev-a/apidocs/javax/ws/rs/container/DynamicFeature.html
>>
>>
>>
>> To be honest I'm actually not sure if 'Feature', as opposed to
>> 'DynamicFeature' can be registered directly with a server, as opposed to
>> a client.  DynamicFeature is definitely supported but need to double
>> check about Feature
>>
>> Perhaps you can implement MessageBodyWriter and may be MessageBodyReader
>> instead, most likely you'd need to do it anyway, so rather than wrapping
>> it all in a feature, simply implement MBR/MBW and register them.
>>
>> Cheers, Sergey
>>
>> On 30/10/15 15:31, Sharif Ghazzawi wrote:
>>> All,
>>>
>>>
>>> I currently have an Apache CXF application into which I am trying to
>>> integrate this library http://katharsis.io/ for the purposes of
>>> serializing objects into json-api compliant payloads.
>>>
>>>
>>>
>>> The documentation here http://katharsis.io/#jax-rs states that it can
>>> be integrated with jax-rs environments by registering an
>>> implementation of javax.ws.rs.Feature with the jax-rs environment.
>>>
>>>
>>> I have been reading through the Apache CXF documentation and have not
>>> been able to find anything explaining how to register an instance of
>>> javax.ws.rs.Feature.
>>>
>>>
>>> Does anyone have any insights as to how this can be accomplished?
>>>
>>>
>>> Thank you,
>>>
>>>
>>> Sharif Ghazzawi
>>>
>>>
>>>
>>
>>
>
>


-- 
Sergey Beryozkin

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

Re: Jso-api/Katharsis.io

Posted by Sergey Beryozkin <sb...@gmail.com>.
Hmm, looks like a Feature can be directly registered with the server 
too. Apparently TCKs do not enforce that...
It can actually be registered on the server with CXF indirectly, from 
DynamicFeature - so what you can do right now is to register a 
DynamicFeature impl that will simply set a Katharsis feature. No need to 
to it on the client side, just register it directly with 2.0 Client


I'll look into having Features supported directly on the server time in 
meantime...

Sergey

On 30/10/15 15:48, Sergey Beryozkin wrote:
> Hi
>
> You can register it as a JAX-RS provider, in
> jaxrs:server/jaxrs:providers, though I'm presuming
> you should implement
>
> https://jax-rs-spec.java.net/nonav/2.0-rev-a/apidocs/javax/ws/rs/container/DynamicFeature.html
>
>
> To be honest I'm actually not sure if 'Feature', as opposed to
> 'DynamicFeature' can be registered directly with a server, as opposed to
> a client.  DynamicFeature is definitely supported but need to double
> check about Feature
>
> Perhaps you can implement MessageBodyWriter and may be MessageBodyReader
> instead, most likely you'd need to do it anyway, so rather than wrapping
> it all in a feature, simply implement MBR/MBW and register them.
>
> Cheers, Sergey
>
> On 30/10/15 15:31, Sharif Ghazzawi wrote:
>> All,
>>
>>
>> I currently have an Apache CXF application into which I am trying to
>> integrate this library http://katharsis.io/ for the purposes of
>> serializing objects into json-api compliant payloads.
>>
>>
>>
>> The documentation here http://katharsis.io/#jax-rs states that it can
>> be integrated with jax-rs environments by registering an
>> implementation of javax.ws.rs.Feature with the jax-rs environment.
>>
>>
>> I have been reading through the Apache CXF documentation and have not
>> been able to find anything explaining how to register an instance of
>> javax.ws.rs.Feature.
>>
>>
>> Does anyone have any insights as to how this can be accomplished?
>>
>>
>> Thank you,
>>
>>
>> Sharif Ghazzawi
>>
>>
>>
>
>


-- 
Sergey Beryozkin

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

Re: Jso-api/Katharsis.io

Posted by Sergey Beryozkin <sb...@gmail.com>.
Hi

You can register it as a JAX-RS provider, in 
jaxrs:server/jaxrs:providers, though I'm presuming
you should implement

https://jax-rs-spec.java.net/nonav/2.0-rev-a/apidocs/javax/ws/rs/container/DynamicFeature.html

To be honest I'm actually not sure if 'Feature', as opposed to 
'DynamicFeature' can be registered directly with a server, as opposed to 
a client.  DynamicFeature is definitely supported but need to double 
check about Feature

Perhaps you can implement MessageBodyWriter and may be MessageBodyReader 
instead, most likely you'd need to do it anyway, so rather than wrapping 
it all in a feature, simply implement MBR/MBW and register them.

Cheers, Sergey

On 30/10/15 15:31, Sharif Ghazzawi wrote:
> All,
>
>
> I currently have an Apache CXF application into which I am trying to integrate this library http://katharsis.io/ for the purposes of serializing objects into json-api compliant payloads.
>
>
>
> The documentation here http://katharsis.io/#jax-rs states that it can be integrated with jax-rs environments by registering an implementation of javax.ws.rs.Feature with the jax-rs environment.
>
>
> I have been reading through the Apache CXF documentation and have not been able to find anything explaining how to register an instance of javax.ws.rs.Feature.
>
>
> Does anyone have any insights as to how this can be accomplished?
>
>
> Thank you,
>
>
> Sharif Ghazzawi
>
>
>


-- 
Sergey Beryozkin

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