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


Gabo Manuel wrote:
> Hi Sergey,
>
> > Can you also do System.out.println(response.getEntity().toString()) 
> in your mapper, before returning ?
>
> 2009-02-17 06:25:53,024 | INFO  [l0-0][             SolegyFaultMapper]

> entity: The server encountered some error. Involved personnel have 
> been notified of this incident. Please contact support for follow-up. 
> Issue #2009480001
>
> TCPMon captured:
> HTTP/1.1 500 Internal Server Error
> Content-Type: text/plain
> Authentication-Info: 
>
nextnonce="MTIzNDg1MTk1MzAzOTphYjk1ZDllOTkzMDEyNWRlZThkY2ExOWExZThjNjYwN
Q==" 
>
> Content-Type: text/plain
> Content-Length: 163
> Server: Jetty(6.1.11)
>
> <Result>The server encountered some error. Involved personnel have 
> been notified of this incident. Please contact support for follow-up. 
> Issue #2009480001</Result>
>
> > I'm bewildered :-) I've no idea where this <Result> is coming 
> from...I've searched the CXF code base for expressions
> > containing 'Result' and found no obvious culprit...
>
> I'm thinking maybe it is translated as a regular bean and that the 
> said class is annotated as such? I tried debugging the         
> OutputStream os = outMessage.getContent(OutputStream.class); step by 
> step to no avail.
>
> Gabo

Reply via email to