You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Ve...@parc.com on 2012/06/17 23:35:21 UTC

WebServiceContext is null

Hi,

How would I get the WebServiceContext in CXFNonSpringJaxrsServlet mode?

I added a


@Resource

private WebServiceContext context;


in one of the Impl classes, but the context is null.


I would like to get hold of the HttpServlerRequest session Id, and found this to be suggested way.



Thanks


Venu

Re: WebServiceContext is null

Posted by Sergey Beryozkin <sb...@gmail.com>.
Hi
On 17/06/12 22:35, Venu.Garimella@parc.com wrote:
> Hi,
>
> How would I get the WebServiceContext in CXFNonSpringJaxrsServlet mode?
>
> I added a
>
>
> @Resource
>
> private WebServiceContext context;
>
>
> in one of the Impl classes, but the context is null.
>
>
> I would like to get hold of the HttpServlerRequest session Id, and found this to be suggested way.
>
WebServiceContext is available during JAX-WS calls, get either 
org.apache.cxf.jaxrs.ext.MessageContext or HttpServletRequest itself 
injected instead. Also try to avoid using @Resource, try @Context instead

HTH, Sergey
>
>
> Thanks
>
>
> Venu


-- 
Sergey Beryozkin

Talend Community Coders
http://coders.talend.com/

Blog: http://sberyozkin.blogspot.com