This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Web Services and the fly likes Stateful web services Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Stateful web services" Watch "Stateful web services" New topic
Author

Stateful web services

Abiodun Adisa
Ranch Hand

Joined: Jan 17, 2002
Posts: 495
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
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41583
    
  54
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.


Ping & DNS - my free Android networking tools app
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Stateful web services