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 13:41:20 GMT
On Thu, 2006-11-02 at 10:00 +0000, Sergey Beryozkin wrote:
> Do we have to write this code oursellves or is it something which will end up in some
common utility class ?

It's a workaround.  The response header should be settable through the
MessageContext. 


> 
> Cheers, Sergey
> 
> 
> > 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