What version of CXF? I know some work was done in this area for 2.1.3. Dan
On Monday 24 November 2008 7:22:33 pm William Blackburn wrote: > I have implemented a webservice and successfully exposed it via soap > using CXF. I have now been asked to set an http response code of 404 > under certain conditions. Though I am not in agreement with straying > into unspecified behavior, I don't have much choice in the matter. I > have tried everything I could find in the documentation to do this, > but cannot make it work. > > I have successfully acquired the web service context using: > > @Resource > WebServiceContext wsc; > > At the point I usually return a value from the service, I have tried > both: > > MessageContext context = wsc.getMessageContext(); > context.put(Message.RESPONSE_CODE, new Integer(404)); > > and > > HttpServletResponse response = (HttpServletResponse) > context.get(AbstractHTTPDestination.HTTP_RESPONSE); > response.setStatus(new Integer(404)); > > In either case, the status code actually received is 200/OK > > What, if any, is the proper way to do this? > > Thanks in advance for any help. -- Daniel Kulp [email protected] http://dankulp.com/blog
