Hi Gabo,

Sorry, missed your message this morning.
If you put your CXF interceptor at POST_PROTOCOL level then it should work.

Can you debug it and see what happens ?

JAXRSOutInterceptor sits at the MARSHALL phase and POST_PROTOCOL should be 
handled after it.
Now that you mentioned it I reckon there's a bug in JAXRSOutInterceptor in that if you add headers from a cxf out interceptor after the invocation has returned but before JAXRSOutInterceptor is invoked then such headers might be lost/overriden - but I need to verify if it's the case.

Implementing ResponseHandler filter is another option, but doing it at 
POST_PROTOCOL with CXF out interceptor should work too...

Cheers, Sergey

Hi All,

I created an out interceptor, subclassing AbstractPhaseInterceptor. The interceptor is invoked fine, however, changes to the response header doesn't seem to reflect. The handleMessage is quite straightforward:

   public void handleMessage(Message message) throws Fault {
       Map<String, List<String>> responseHeaders = (Map<String, 
List<String>>)message.get(Message.PROTOCOL_HEADERS);
       logger.info("out message headers: " + responseHeaders);
      if (responseHeaders != null) {
           responseHeaders.put("Authentication-Info", Arrays.asList(new 
String[]{"nextnonce="+generateNonce()}));
       }
       logger.info("out message headers: " + responseHeaders);
   }

I have tried several phases:
1. SETUP -- the responseHeader is null
2. PRE_PROTOCOL - POST_PROTOCOL -- the changes to the header does not reflect.

Again, my thanks for the assistance.

Gabo



Reply via email to