You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Cory Wilkerson <cw...@travelnow.com> on 2003/01/31 18:03:33 UTC

Session Management

All,

Subsequent client requests to my service don't appear to be retaining state.  I'm certain that I'm missing something rather trivial here re: session management but I can't find any documentation regarding the matter.  That said, I have found the following tid bit:
"It is up to some handler on the request chain to set up an appropriate Session implementation and attach it to the MessageContext with MessageContext.setSession() so that anyone who wants to use session semantics can get at it."  
I see the lovely AxisHttpSession object that can be constructed from an HttpServletRequest or HttpSession -- but I'm unsure of how to get to either/both through a handler OR a service.  Any input is warmly welcomed.
Thanks!
Cory




Re: Session Management

Posted by Barry Levinson <ba...@levinson.us>.
Cory,

First, on your server, set scope to session in your deploy.wsdd.

The client will also need to cooperate with session scope; the client 
needs to hold onto the cookie returned by Axis.

For a .NET client, the client must be able to accept a cookie.  All you 
need to do is to add a CookieContainer to your 
service client class.  Use the following code (C#) :

some.url.of.service.someService myService = new 
some.url.of.service.someService() ;
myService.CookieContainer = new System.Net.CookieContainer() ;

(substituse your web reference class for "some.url.of.service.someService")

For an Axis client, you only need to set maintain session to true.

--Barry

bin wrote:

>if u take a look at samples.userguide.example4.LogHandler you will see u
>have to implement invoke( MessageContext msgContext ) in a Handler
>
>however i was also wondering how does a Service get a reference to the
>MessageContext?
>
>thanks
>
>bin
>
>  
>
>>All,
>>
>>Subsequent client requests to my service don't appear to be retaining
>>state.  I'm certain that I'm missing something rather trivial here re:
>>session management but I can't find any documentation regarding the
>>matter.  That said, I have found the following tid bit:
>>"It is up to some handler on the request chain to set up an appropriate
>>Session implementation and attach it to the MessageContext with
>>MessageContext.setSession() so that anyone who wants to use session
>>semantics can get at it."
>>I see the lovely AxisHttpSession object that can be constructed from an
>>HttpServletRequest or HttpSession -- but I'm unsure of how to get to
>>either/both through a handler OR a service.  Any input is warmly welcomed.
>>Thanks!
>>Cory
>>
>>
>>
>>
>>    
>>
>
>  
>


RE: Session Management

Posted by Josh Kropf <jo...@slashdev.ca>.
MessageContext.getMessageContext()

-----Original Message-----
From: bin [mailto:binz@juke.biz]
Sent: Friday, January 31, 2003 3:04 PM
To: axis-user@xml.apache.org
Subject: Re: Session Management


if u take a look at samples.userguide.example4.LogHandler you will see u
have to implement invoke( MessageContext msgContext ) in a Handler

however i was also wondering how does a Service get a reference to the
MessageContext?

thanks

bin

> All,
>
> Subsequent client requests to my service don't appear to be retaining
> state.  I'm certain that I'm missing something rather trivial here re:
> session management but I can't find any documentation regarding the
> matter.  That said, I have found the following tid bit:
> "It is up to some handler on the request chain to set up an appropriate
> Session implementation and attach it to the MessageContext with
> MessageContext.setSession() so that anyone who wants to use session
> semantics can get at it."
> I see the lovely AxisHttpSession object that can be constructed from an
> HttpServletRequest or HttpSession -- but I'm unsure of how to get to
> either/both through a handler OR a service.  Any input is warmly welcomed.
> Thanks!
> Cory
>
>
>
>



Re: Session Management

Posted by bin <bi...@juke.biz>.
if u take a look at samples.userguide.example4.LogHandler you will see u
have to implement invoke( MessageContext msgContext ) in a Handler

however i was also wondering how does a Service get a reference to the
MessageContext?

thanks

bin

> All,
>
> Subsequent client requests to my service don't appear to be retaining
> state.  I'm certain that I'm missing something rather trivial here re:
> session management but I can't find any documentation regarding the
> matter.  That said, I have found the following tid bit:
> "It is up to some handler on the request chain to set up an appropriate
> Session implementation and attach it to the MessageContext with
> MessageContext.setSession() so that anyone who wants to use session
> semantics can get at it."
> I see the lovely AxisHttpSession object that can be constructed from an
> HttpServletRequest or HttpSession -- but I'm unsure of how to get to
> either/both through a handler OR a service.  Any input is warmly welcomed.
> Thanks!
> Cory
>
>
>
>