Hi Gabo

Many thanks for creating the JIRAs.
ExceptionMappers are not CXF interceptors, they can be categorized as
JAXRS providers only. I'm still unclear at all as to where such Result
tags may come from - needs to be investigated indeed. It looks like
text_plain responses are wrapped ?  

Cheers, Sergey 


-----Original Message-----
From: Gabo Manuel [mailto:[email protected]] 
Sent: 17 February 2009 11:43
To: [email protected]
Subject: Re: [JAX-RS] Fault handling

Hi Sergey,

Thanks for the update.

> If you could create a JIRA and attach a sample interceptor and a
sample
> service class then it would help a lot and ensure the issue is
tracked.

https://issues.apache.org/jira/browse/CXF-2045
 - this is for the headers being lost

https://issues.apache.org/jira/browse/CXF-2046
 - this is for the result tag. Sorry, I forgot to adjust the level to
minor.

> Another issue was that Result prefixes were added if you used the CXF
> custom interceptor. I'm wondering, was it caused by the fact that the
> chain was aborted (as a workaround around the issue of headers being
> lost)?

The abort of the chain has been removed as per previous post. I am now 
using a ResponseHandler implementation to change the headers. But the 
behavior remains the same, i.e. the Result tag is still there. Also, I 
am assuming that the ExceptionMapper implementation is categorized as a 
custom interceptor. We could rule out the chain abort now. :)

> By the way, MultivaluedMap has Lists as values, so if you do prefer to
> reuse the code which deals with Lists then you just use
> MultivaluedMap.put(), add() is a utility method which creates a List
if
> it's not there...

I didn't notice that. Will adjust my code. :)

Again, my thanks.

Gabo

Sergey Beryozkin wrote:
> Hi Gabo
>
> So it does look like Result prefixes are added by the outbound chain
> somewhere. 
>
> I'm sorry I didn't investigate the issue with custom headers being
lost
> when added in a CXF out interceptor - but now that you posted some
code
> in the other email I will try to reproduce the problem. 
>
> If you could create a JIRA and attach a sample interceptor and a
sample
> service class then it would help a lot and ensure the issue is
tracked.
> I'd like to get it fixed as it's important that when JAXWS and JAXRS
is
> combined then a single CXF interceptor can be shared to do some custom
> header post-processing.
>
> Another issue was that Result prefixes were added if you used the CXF
> custom interceptor. I'm wondering, was it caused by the fact that the
> chain was aborted (as a workaround around the issue of headers being
> lost)?
>
> By the way, MultivaluedMap has Lists as values, so if you do prefer to
> reuse the code which deals with Lists then you just use
> MultivaluedMap.put(), add() is a utility method which creates a List
if
> it's not there...
>
> Thanks, Sergey
>
> -----Original Message-----
> From: Gabo Manuel [mailto:[email protected]] 
> Sent: 17 February 2009 10:51
> To: [email protected]
> Subject: Re: [JAX-RS] Fault handling
>
> Hi Sergey,
>
> I have replaced the CXFInterceptor with a ResponseHandler 
> implementation. So no chain-abort now. Body of the handleResponse is
as 
> follows:
>
>         MultivaluedMap<String, Object> map = response.getMetadata();
>         map.add("Authentication-Info", 
> "nextnonce=\""+RestHandlerUtility.generateNonce(base_path)+"\"");
>         logger.debug("out message headers: " + map);
>         logger.info("response: " + response.getEntity());
>
> As of this point, the entity still does not contain the Result tag
>
> Again, my thanks.
>
> Gabo
>   

Reply via email to