I'm looking into writing a login/session handling system in EJB3. This is what I'm thinking: Entity Bean -> Session Facade -> Session Bean (business logic, stateful) -> WebService implementation (stateless session bean). But what I don't understand is; how does the stateless webservice session bean know which stateful session bean to contact? How does this happen? Also, this problem has to have been solved before -- how to generate unique sessionID for the client etc. Does anyone have info/links that could be of help?
- Posted by: Bj??rn B??rresen
- Posted on: August 24 2006 10:26 EDT
- Re: EJB3: Stateful session bean servicing stateless webservice bean by Bhagvan Kommadi on August 27 2006 20:18 EDT
- Re: EJB3: Stateful session bean servicing stateless webservice b by Bj??rn B??rresen on August 28 2006 03:46 EDT
- Re: EJB3: Stateful session bean servicing stateless webservice b by Yuriy Dumchikov on March 01 2008 00:45 EST
to answer your question, you need to have separate authenticate/security session bean whose acls are non restrictive for a guest to pass in his credentials... once authenticated against LDAP/Database/NTLM, you can get a handle creating a stateful session bean, the handle info is stored in httpsession or any secondary data source... Bhagvan K http://www.jroller.com/page/bhagvank
Thanks for your reploy Bhagvan! You say a a statefull session bean handle is stored in HTTPSession .. that sounds like what I want to do. But what I don't understand is the lookup the webservice bean does to find the stateful session bean for a particular client. Cause the client needs to go through the webservice no matter what (this is going to be an API open to authenticated users). Do you have some example code of that, or maybe a link explaining it?
Only Stateless Session Bean can be exposed as a Web Service