• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Stateful web services

 
Ranch Hand
Posts: 495
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am trying to implement a stateful Jaxrpc web service application, I have my main class implementing
ServiceLifecycle and added two methods

public void init(Object context) throws ServiceException {
if (jaxrpcContext == null) {
jaxrpcContext = (ServletEndpointContext) context;
}


}

public void destroy() {
jaxrpcContext = null;
}

I have written the code to obtain the Session
HttpSession hp=jaxrpcContext.getHttpSession();
but it seems method call by the client results in a new Session everytime. Any suggestions to this
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have always steered clear of stateful WS, but I would guess that you need to send the session ID back to the client, and that the client needs to send it back to the server with the next request. Or is that done automatically? Your experience suggests that it may not.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic