Steve Jagels [
http://community.jboss.org/people/sej] created the discussion
"WebServiceContext"
To view the discussion, visit:
http://community.jboss.org/message/566143#566143
--------------------------------------------------------------
I'm trying to have a web service store info to a session that is unique for each
consumer.
@Resource
private WebServiceContext wsContext;
@WebMethod
@WebResult(name="MyMethodResponse")
public Integer MyMethod(){
MessageContext mc = wsContext.getMessageContext();
HttpSession session =
((javax.servlet.http.HttpServletRequest)mc.get(MessageContext.SERVLET_REQUEST)).getSession();
Integer count = (Integer) session.getAttribute("count");
if(null == count){
count = 0;
System.out.println("new session id=" + session.getId());
}
count++;
session.setAttribute("count", count);
return count;
}
The count is supposed to be incremented each time I go through this method, but it does
not.
Is there something I need to add to the consumer code for this? Any other ideas?
I'm using Eclipse 3.4.2, jboss 4.2.3.GA, jdk 1.5.0_17.
--------------------------------------------------------------
Reply to this message by going to Community
[
http://community.jboss.org/message/566143#566143]
Start a new discussion in JBoss Web Services Development at Community
[
http://community.jboss.org/choose-container!input.jspa?contentType=1&...]