cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mustafa Egilmezbilek" <egilmezbi...@gmail.com>
Subject Re: WebServiceContext is null
Date Fri, 28 Sep 2007 05:35:35 GMT
Thanks Dave, How do you set http transport in CXF ?


On 9/27/07, Dave Kallstrom <dave.kallstrom@gmail.com> wrote:
>
> This is  how i get the httpRequest
> @Resource
> private WebServiceContext context;
> private HttpServletRequest getHttpRequest()
>     {
>         MessageContext ctx = getContext().getMessageContext();
>         HttpServletRequest request = (HttpServletRequest) ctx.get(
> AbstractHTTPDestination.HTTP_REQUEST);
>         return request;
>     }
>
> Be careful though, this only works when you are using http transport.
> On 9/27/07, Mustafa Egilmezbilek <egilmezbilek@gmail.com> wrote:
> >
> > Hi,
> >
> > I am trying to access WebServiceContext to be able use HttpSession as
> > described in: http://cwiki.apache.org/CXF20DOC/servlet-transport.html,
> but
> > I
> > keep getting null. What might be the reason ?
> >
> >
> > @Resource
> >
> > *public* WebServiceContext wsContext;
> > protected HttpSession getHttpSession() {
> >   MessageContext mc = *wsContext*.getMessageContext();
> >         HttpSession session = ((javax.servlet.http.HttpServletRequest
> > )mc.get(MessageContext.SERVLET_REQUEST)).getSession();
> >         return session;
> > }
> >
> >
> >
> > Thanks,
> >
> > Karakoyun
> >
>
>
>
> --
> Dave Kallstrom
>



-- 
Mustafa Egilmezbilek

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message