Hi group,

 

I've found this old message in the mailing list about a topic which I also have 
to think about again.

 

Is there a nicer, maybe standard, way to end a soapsession? What is the best 
way to destroy a session and all related resources, like eg. licenses?

 

Hoping for your help,

Matthias.

 

Von: LIE Jorund [mailto:[EMAIL PROTECTED] 
Gesendet: Mittwoch, 2. April 2008 17:07
An: axis-user@ws.apache.org
Betreff: RE: SOAP-Session management; terminate session.

 

I found a workaround for (2.) by setting the lastTouchedTime for the service 
group context to 0, the next cleanup will then destroy the session context. In 
the service class there is a method like this:

 

public void endSession()

{

    ServiceGroupContext serviceGroupContext = 
MessageContext.getCurrentMessageContext().getServiceGroupContext();

    serviceGroupContext.setLastTouchedTime(0);

}

 

This seems to do the trick, although I do not feel that the solution is very 
clean.

 

Jørund

 

________________________________

From: LIE Jorund 
Sent: Tuesday, April 01, 2008 11:12 AM
To: axis-user@ws.apache.org
Subject: SOAP-Session management; terminate session.

I would need to use the SOAP session management facilities in Axis2-1.3, and I 
have a question about terminating a session.

 

Following the description for session management I have prepared a small 
prototype web service that initiates the session, returns the service group ID 
for the session to the client, and receives subsequent requests using the 
session ID. If there are no requests for a session-ID during a context timeout 
interval (set to 30 sec) the session becomes inactive. So far so good, this 
works fine, but I have 2 questions tough.

 

1. From tracing the destroy() method of my web service class I see that the 
object instance is not destroyed immediately after the context timeout. It 
seems like the session becomes stale, and that the object instance 
corresponding to stale sessions are destroyed after any new request to the web 
service. Is this correct?

 

2. I would like to find a way to terminate the sessions triggered by a certain 
operation (e.g. by a logout), not by the inactivity timeout. How can this be 
achieved in a clean way?

 

Thanks and Regards.

Jørund Lie

Reply via email to