• Post Reply Bookmark Topic Watch Topic
  • New Topic

should same cleint, different soap request for the same service in the same session?

 
grace smith
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I tried this way to make a session tracking in web service:

in the service SEI, I let it implement the ServiceLifecycle in order to access the HttpSessionContext and do the resource session management there.

in the client, I add the property setting for the stub to indicate the client will participate with the session management,
stub._setProperty(Stub.SESSION_MAINTAIN_PROPERTY, Boolean.TRUE);

when I run the client and monitor the service transaction in the TCP/IP monitor, I see each time, in the same brower,every time you run the same client request, the http response header will have different JSESSIONID added in the header.

Should the same client(same web browser window) for the same service request stay in the same session?
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does each request (starting with the second) contain the sessionID that is returned with the first response? Otherwise, the server would have no idea that the request is associated with an existing session, and would create a new one.
 
grace smith
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I bet my problem could be that my client code let each request initiates a new service stub, since each stub will start a new session, so it results in that each request will get a different JSESSIONID added in the response header.

I just modified the code and let the client only iniciate a new stub through the service locator at the first request, later stub reference will be pulled out from session. In this way, same client will call the same service from the same stub and will be bound within the same session.

After I changed my client code in this way, then I go back to the TCP/IP monitor, I see only the first response send a new JSESSIONID in the header, then later response based on the same client's different request to the same service will has no JSESSIONID shows up in the response header anymore. If I open a second browser window to simulate a second client request, then this response will has a nother new JSESSIONID added in it's header. Is the result correct now?

At nowhere I can see the request header contains the JSESSIONID, should it be there? and I only see the first response has the new JSESSIONID in the header. the subsequent response will has no JSESSIONID in the header.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!