Hi

Rather than aborting the chain, just let the flow to continue.

the JAXRSInvoker will notice the current response and let
JAXRsOutInterceptor to deal with it eventually.

Otherwise you'd need to create an out message yourself, set it on the
exchange and wrap your custom response in CXF MessageContentList :

Message outMessage = new MessageImpl();
exchange.setOutMessage(outMessage);
outMessage.setContent(List.class, new MessageContentList(yourResponse));

A much easier option is also to register a custom JAXRS filter and just
return a non-null Response

cheers, Sergey

On Tue, Oct 12, 2010 at 7:26 PM, rangeli nepal <[email protected]>wrote:

> Good Afternoon,
>
> Currently I am writting an interceptor. During certain condition, it
> needs to send the message ( a xml document, or location) back to the
> client and stop further processing.
> I thought if I do following. I will achieve it but I am not. Any
> suggestion will be highly appreciated.
> Thank you.
> rn
>
>
> this.message.getExchange().put(Response.class, rsp); // message is an
> instance of  org.apache.cxf.message.Message
> message.getInterceptorChain().abort();
> return
>
> rsp looks like following:
>
>
>                ResponseBuilder builder=Response.ok(entity);  //entity is an
> xml document
>                Response rsp=return builder.build();
>

Reply via email to