Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Creating session state without http or ejb

Reply
Thread Tools

Creating session state without http or ejb

 
 
iksrazal@gmail.com
Guest
Posts: n/a
 
      12-02-2005
Hi all,

I want to duplicate a feature I used in an ejb-based web service, in an
non-ejb tomcat-based web service. I want to allow a user to login via a
web service, on successful authentication return a session id String,
and on future call pass in the session id:

public ReturnWeb_Login web_Login(
String user_name,
String user_password) throws RemoteException {

soap_session_id = serviceLocator.getSoapSession_Id(soapSession);
if (athenticate(user_name,user_password)) {
return new ReturnWeb_Login (soap_session_id, user_name);
}
}

The idea here is that soap_session_id is generated from a Stateful
Session bean, and times out. Once logged in, subsequent calls are like:

public ReturnWeb_Base doSomething(
String soap_session_id) throws RemoteException {

//check authorization
SoapSession soapSession = checkAuthorization(soap_session_id);
if(soapSession!=null) {
//do something
}
}

The above works without messing around with the internal servlet the
web service uses, axis in this case.

My question is simple, though the answer may be difficult: How can I
create a session id that times out, independent of http or ejb ?

iksrazal

 
Reply With Quote
 
 
 
 
Chris Smith
Guest
Posts: n/a
 
      12-03-2005
<(E-Mail Removed)> wrote:
> The above works without messing around with the internal servlet the
> web service uses, axis in this case.
>
> My question is simple, though the answer may be difficult: How can I
> create a session id that times out, independent of http or ejb ?


You absolutely can't create a session without HTTP. I doubt that your
code in your EJB container would have worked outside of HTTP as a
transport protocol, and you can't write the code yourself in Tomcat/Axis
without referencing the classes HttpServletRequest and HttpSession.

You'll also need to use one Axis-specific class, namely MessageContext.
This will be used to get the HttpServletRequest in the first place.

--
www.designacourse.com
The Easiest Way To Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Possible to generate "ejb-jar.xml" from EJB class (source)? "ejb-jar.xml" appserver independent? Raymond Schanks Java 0 08-03-2010 08:21 AM
Unable to make the session state request to the session state server Maciek ASP .Net 0 09-15-2005 08:49 PM
Unable to serialize the session state. Please note that non-serializable objects or MarshalByRef objects are not permitted when session state mode is 'StateServer' or 'SQLServer'. Mike Larkin ASP .Net 1 05-23-2005 12:33 PM
Unable to make the session state request to the session state server Not Liking Dot Net Today ASP .Net 0 04-21-2004 11:54 AM
unable to make the session state request to the session state server shamanthakamani ASP .Net 1 11-20-2003 04:51 AM



Advertisments