-
1. Re: How can I get the session id?
chicochen Jan 4, 2008 10:28 PM (in response to chicochen)Also, is there a good way to keep http session in jboss seem actions calling via web service method?
@Stateless @Name("AuthenticateWebService") @WebService(name = "AuthenticateWebService", serviceName = "AuthenticateWebService") public class AuthenticateWebService implements AuthenticateWebServiceRemote { //@In(value = "authenticateAction", create = true) //private AuthenticateAction authenticateAction; @WebMethod public String login(String username, String password) { Identity.instance().setUsername(username); Identity.instance().setPassword(password); Identity.instance().login(); if (Identity.instance().isLoggedIn()){ ResponseInfo rInfo = ResponseInfo.getSuccessInfo(); String xml = BeanXMLMapping.toXML(rInfo); return xml; } else { ResponseInfo rInfo = ResponseInfo.getFailInfo(); String xml = BeanXMLMapping.toXML(rInfo); return xml; } }
-
2. Re: How can I get the session id?
pmuir Jan 5, 2008 8:30 AM (in response to chicochen)How are you calling authenticateAction.authenticate()?
-
3. Re: How can I get the session id?
chicochen Jan 5, 2008 8:59 PM (in response to chicochen)Identity.instance.login will call "authenticate" method that config in component.xml, isn't it?
-
4. Re: How can I get the session id?
pmuir Jan 6, 2008 4:34 PM (in response to chicochen)Yes, so are you calling it from a JSF view?
-
5. Re: How can I get the session id?
chicochen Jan 6, 2008 8:29 PM (in response to chicochen)No, I call this webservice method from flash lite client.
I like to get the jsessionid and send it back via request url, is there any good way? -
6. Re: How can I get the session id?
pmuir Jan 7, 2008 5:28 AM (in response to chicochen)"chicochen" wrote:
No, I call this webservice method from flash lite client.
Ok, so this is why there is no FacesContext (you aren't in a faces request). -
7. Re: How can I get the session id?
chicochen Jan 7, 2008 7:08 AM (in response to chicochen)So, do you have any good way to solve it?
-
8. Re: How can I get the session id?
christian.bauer Jan 7, 2008 7:22 AM (in response to chicochen)Don't beg, use: ServletContexts.instance().getRequest().getSession()
-
9. Re: How can I get the session id?
chicochen Jan 7, 2008 9:19 PM (in response to chicochen)But ServletContexts.instance().getRequest() always return null, how can I keep the session?thanks.
-
10. Re: How can I get the session id?
chicochen Jan 9, 2008 3:43 AM (in response to chicochen)up, need your help!
-
11. Re: How can I get the session id?
pmuir Jan 9, 2008 7:34 PM (in response to chicochen)Don't bump. *think* about why you can't get get the session id in a web service. Then understand your request makes no sense.
-
12. Re: How can I get the session id?
chicochen Jan 14, 2008 8:36 PM (in response to chicochen)Anyone can help me?
-
13. Re: How can I get the session id?
nickarls Jan 15, 2008 1:50 AM (in response to chicochen)
But ServletContexts.instance().getRequest() always return null
You already got the correct answer from the method as I understand it.