You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Justin Robbins <ju...@gmail.com> on 2012/08/06 23:30:20 UTC

setting "ignore.response.writers" in ResponseHandler

Hello,

I am using a custom ResponseHandler.

The documentation states you can ignore the MessageBodyWriter (Jackson in
my case) by setting the following property:
message.getExchange().put("ignore.response.writers", true);

I am setting the property but Jackson is still handling the serialization.
Is there something else I should be aware of?

I can confirm my ResponseHandler is getting called and I am returning a
null from this method.

http://cxf.apache.org/docs/jax-rs-filters.html#JAX-RSFilters-IgnoringJAXRSMessageBodyWriters

I am using CXF v2.5.2.

Many thanks!

Justin

Re: setting "ignore.response.writers" in ResponseHandler

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

On 07/08/12 19:59, Justin Robbins wrote:
> Sergey,
>
> Many thanks for your reply.
>
> I think I am confused.  I see the docs refer to
> "ignore.response.writers" but I'm finding "ignore.message.writers" in
> JAXRSUtils.
>
> Can you please explain the difference between these two properties.
>
> Thanks from a fan of CXF!

I've fixed the documentation typo [1], sorry about it :-)

many thanks
Sergey

[1] https://cwiki.apache.org/confluence/display/CXF20DOC/JAX-RS+Filters
>
> On Tue, Aug 7, 2012 at 7:30 AM, Sergey Beryozkin <sberyozkin@gmail.com
> <ma...@gmail.com>> wrote:
>
>     Hi
>
>     On 07/08/12 00:30, Justin Robbins wrote:
>
>         Hello,
>
>         I am using a custom ResponseHandler.
>
>         The documentation states you can ignore the MessageBodyWriter
>         (Jackson in
>         my case) by setting the following property:
>         message.getExchange().put("__ignore.response.writers", true);
>
>         I am setting the property but Jackson is still handling the
>         serialization.
>         Is there something else I should be aware of?
>
>         I can confirm my ResponseHandler is getting called and I am
>         returning a
>         null from this method.
>
>         http://cxf.apache.org/docs/__jax-rs-filters.html#JAX-__RSFilters-__IgnoringJAXRSMessageBodyWriter__s
>         <http://cxf.apache.org/docs/jax-rs-filters.html#JAX-RSFilters-IgnoringJAXRSMessageBodyWriters>
>
>
>     Works OK for me, I updated the test response handler and could see
>     that this property was taking effect.
>     Do you have a non null Response entity and set this property ? In
>     this case the provider will write directly to the stream.
>
>     Please provide a bit more info
>
>     Cheers, Sergey
>
>
>         I am using CXF v2.5.2.
>
>         Many thanks!
>
>         Justin
>
>
>
>
>
>
> --
> Regards,
> Justin Robbins
> 973.479.0448
> JustinHRobbins@gmail.com <ma...@gmail.com>
>

Re: setting "ignore.response.writers" in ResponseHandler

Posted by Justin Robbins <ju...@gmail.com>.
Sergey,

Many thanks for your reply.

I think I am confused.  I see the docs refer to "ignore.response.writers"
but I'm finding "ignore.message.writers" in JAXRSUtils.

Can you please explain the difference between these two properties.

Thanks from a fan of CXF!

On Tue, Aug 7, 2012 at 7:30 AM, Sergey Beryozkin <sb...@gmail.com>wrote:

> Hi
>
> On 07/08/12 00:30, Justin Robbins wrote:
>
>> Hello,
>>
>> I am using a custom ResponseHandler.
>>
>> The documentation states you can ignore the MessageBodyWriter (Jackson in
>> my case) by setting the following property:
>> message.getExchange().put("**ignore.response.writers", true);
>>
>> I am setting the property but Jackson is still handling the serialization.
>> Is there something else I should be aware of?
>>
>> I can confirm my ResponseHandler is getting called and I am returning a
>> null from this method.
>>
>> http://cxf.apache.org/docs/**jax-rs-filters.html#JAX-**RSFilters-**
>> IgnoringJAXRSMessageBodyWriter**s<http://cxf.apache.org/docs/jax-rs-filters.html#JAX-RSFilters-IgnoringJAXRSMessageBodyWriters>
>>
>>
> Works OK for me, I updated the test response handler and could see that
> this property was taking effect.
> Do you have a non null Response entity and set this property ? In this
> case the provider will write directly to the stream.
>
> Please provide a bit more info
>
> Cheers, Sergey
>
>
>  I am using CXF v2.5.2.
>>
>> Many thanks!
>>
>> Justin
>>
>>
>
>


-- 
Regards,
Justin Robbins
973.479.0448
JustinHRobbins@gmail.com

Re: setting "ignore.response.writers" in ResponseHandler

Posted by Sergey Beryozkin <sb...@gmail.com>.
Hi
On 07/08/12 00:30, Justin Robbins wrote:
> Hello,
>
> I am using a custom ResponseHandler.
>
> The documentation states you can ignore the MessageBodyWriter (Jackson in
> my case) by setting the following property:
> message.getExchange().put("ignore.response.writers", true);
>
> I am setting the property but Jackson is still handling the serialization.
> Is there something else I should be aware of?
>
> I can confirm my ResponseHandler is getting called and I am returning a
> null from this method.
>
> http://cxf.apache.org/docs/jax-rs-filters.html#JAX-RSFilters-IgnoringJAXRSMessageBodyWriters
>

Works OK for me, I updated the test response handler and could see that 
this property was taking effect.
Do you have a non null Response entity and set this property ? In this 
case the provider will write directly to the stream.

Please provide a bit more info

Cheers, Sergey

> I am using CXF v2.5.2.
>
> Many thanks!
>
> Justin
>