axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mmostt...@bco.com
Subject RE: session management problem
Date Mon, 23 Aug 2004 15:38:54 GMT
Tomi,
I am confused by your last statement 
 
>> when I call another Service with the same AXISSession there will be a new
HTTPSession generated 
 
Can you elaborate on what you mean here?  I am not certain I completely
follow but I think your issue is the application server session id.  My
assumption here is that you may need to utilize the cookie session
management instead of the soap header session management.  If you use
cookies then the session id cookie created by the app server (httpsession)
should match your axissession.  You may also want to look into the session
listener that axis uses.
 
marcus

-----Original Message-----
From: Dorner Thomas [mailto:Thomas.Dorner@t-systems.com] 
Sent: Sunday, August 22, 2004 11:58 PM
To: axis-user@ws.apache.org
Subject: AW: session management problem



Hello marcus,

 

thanks for reply - but you dont understand my problem - or I havent explain
it will enough.

 

What you are doing is the right solution I think - we do it the same way
since a long time.

 

But we use the sessionID behind the WebServices for a usermanagement.

Our Subjects for every user are identivid by the sessionID.

So when the session will be destroyed by a timeout, I need a notification!

--> for destroying my Subject too!!!

 

But I don't know a way to do this.

 

When a AXISSession is generated there is also parallel HTTPSession

And with the HTTPSession I am able to solve my problem.

The realy bad thing is - when I call another Service with the

same AXISSession there will be a new HTTPSession generated :-(

 

Some IDEA ?

 

Thanks Tomi

 


  _____  


Von: mmosttler@bco.com [mailto:mmosttler@bco.com] 
Gesendet: Sonntag, 22. August 2004 00:51
An: axis-user@ws.apache.org
Betreff: RE: session management problem

 

I encountered the same issue where we have multiple service endpoint classes
that need to be utilized in a single client session

on theserver and the services need to share information in the session.  The
way I solved this problem was to add a factory class in front of the

client stubs.  The factory stores the session id (retrieved after first
service request) and sets the session id into the client service stubs 

before returning it for use.

 

This is done by getting and setting the session id in the client axis engine
options collection.

 

This same approach was used in our java and .net clients.

 

I am not sure that this is the best approach but it did accomplish our goal.

 

marcus

 

-----Original Message-----
From: Dorner Thomas [mailto:Thomas.Dorner@t-systems.com] 
Sent: Friday, August 20, 2004 8:43 AM
To: axis-user@ws.apache.org
Subject: AW: session management problem

Thank you for your quick reply,

 

I do it the same way you post in your Email.

 

As long as you use only one WebService with a generated AXIS-Session,

there is no problem - so u have also only one HttpSession (HTTPSession =
AXISSession) !

 

And we can use the AxisHTTPSessionListener!

 

But when I want to use one AXISSession over different Webservices, I got a
HTTPSession for every WebService

I call.

 

Have someone a solution for such an usecase?

Can someone please give me tip - how I can solve this problem??? 

 

Thanks in advance for help

Thomas

 


  _____  


Von: Wagle, Shriniwas [mailto:Shriniwas_Wagle@sra.com] 
Gesendet: Freitag, 20. August 2004 16:31
An: axis-user@ws.apache.org
Betreff: RE: session management problem

 

I haven't tried it, but if I had a need I'd try something like this:

- Start with the message context and go on from there.  Something like..

 

msgC = MessageContext.getCurrentContext();
(HttpServletRequest)msgC.getProperty(HTTPConstants.MC_HTTP_SERVLETREQUEST);

>From this point on, you should be able to do the usual stuff.  Also take a
look at Axis API docs.

 


  _____  


From: Dorner Thomas [mailto:Thomas.Dorner@t-systems.com] 
Sent: Friday, August 20, 2004 10:09 AM
To: axis-user@ws.apache.org
Subject: session management problem

Hello,

  

I use Apache Axis sessions (SOAP-Haeder based) and I need to know when a
session was destroyed, but I can't find a session timeout notifying
mechanism for axis.

Does anybody have any idea?

 

Hope somebody can give me a tip :-(

 

There is a similar solution for standard servlets based on
HttpSessionBindingListener :

 

 

import java.io.*;

import java.net.*;

import java.util.*;

import java.lang.*;

import javax.servlet.*;

import javax.servlet.http.*;

 

public class TestSessionServer extends HttpServlet

{

public void doGet(HttpServletRequest req, HttpServletResponse res) throws
ServletException, IOException

{

res.setContentType("text/html");

PrintWriter out = res.getWriter();

String command = req.getParameter("command");

HttpSession session = req.getSession(true);

session.setMaxInactiveInterval(180);

session.setAttribute("SessionObjName", new SessionTimeoutNotifier());

System.out.println("The command you typed was : "+command);

out.println("You typed : "+command);

out.println("Your session id is : "+session.getId());

} // End of doGet method

}

 

class SessionTimeoutNotifier implements HttpSessionBindingListener

{

SessionTimeoutNotifier()

{

}

public void valueBound(HttpSessionBindingEvent event)

{

System.out.println("The session has started : "+event.getSession().getId());

}

 

public void valueUnbound(HttpSessionBindingEvent event)

{

System.out.println("The session has ended : "+event.getSession().getId());

}

}

 

 

Thanks Thomas

 


Mime
View raw message