You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by me <ml...@e-beyond.de> on 2007/12/07 22:59:41 UTC

Getting Session

Hi there,

I'm currently changing from xfire to cxf. Within the services (some
rest and some soap) I need to access the session (Ok I know that I
shouldn't do it but that's another point).

Within xfire I can use:

XFireServletController.getRequest().getSession()

Is there any way within cxf to get it?
I've looked at the api-doc but there wasn't anything that sounds this
way.

thanks for your help.

Marc



Re: Getting Session

Posted by Willem2 <ni...@iona.com>.
Hi , 
You can use WebServiceContext to get the session.
    @Resource
    private WebServiceContext context;

Here is an example[1][2] to show that in CXF Systest

[1] Server 
https://svn.apache.org/repos/asf/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http/GreeterSessionImpl.java
[2] Client 
https://svn.apache.org/repos/asf/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http/ClientServerSessionTest.java

Willem.

me-76 wrote:
> 
> Hi there,
> 
> I'm currently changing from xfire to cxf. Within the services (some
> rest and some soap) I need to access the session (Ok I know that I
> shouldn't do it but that's another point).
> 
> Within xfire I can use:
> 
> XFireServletController.getRequest().getSession()
> 
> Is there any way within cxf to get it?
> I've looked at the api-doc but there wasn't anything that sounds this
> way.
> 
> thanks for your help.
> 
> Marc
> 
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Getting-Session-tf4964771.html#a14224552
Sent from the cxf-user mailing list archive at Nabble.com.