cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Conrad O'Dea" <conrad.o...@iona.com>
Subject Re: setting HTTP response headers
Date Thu, 02 Nov 2006 09:40:52 GMT
On Thu, 2006-11-02 at 07:48 +0000, Conrad O'Dea wrote:

> thanks for that.  The code I'm writing is basically JAX-WS (although
> becoming more cxf specific).  Is it possible to get from the
> EndpointImpl to the outMessage?
> 

I've managed to get the response header successfully set.  There's a
path to the outbound Message through the MessageContext:

  WrappedMessageContext wmc = (WrappedMessageContext)ctx;
  Message msg = wmc.getWrappedMessage();
  Exchange xchg = msg.getExchange();
  Message outMsg = xchg.getOutMessage();
  respHeaders = (Map<String, List<String>>)outMsg.get(Message.PROTOCOL_HEADERS);
  respHeaders.put(headerName, headerValue);

and then the headers I set appear in the HTTP response.




Mime
View raw message