Meaningless Drivel is fun!*
The moose likes Web Services and the fly likes Session maintenance with j2ee generated stub Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Session maintenance with j2ee generated stub" Watch "Session maintenance with j2ee generated stub" New topic
Author

Session maintenance with j2ee generated stub

Julien Martin
Ranch Hand

Joined: Apr 24, 2004
Posts: 384
Hello,

I am trying to maintain state between a JSE endpoint and a servlet that acts as a client.

Here is the code for the client:


and here is the code for the JSE endpoint:



Here is the output from the console:



As you can see, I have enabled session maintenance and still it does not work. FYI, I use Jboss 4.0.3. Can anyone help please??

Thanks in advance,

Julien.
wise owen
Ranch Hand

Joined: Feb 02, 2006
Posts: 2023
int sum = getAdderWebServiceSEIPort().add(4);

Then every time you will create a new stub. You may need to keep it for each httpsession.
Julien Martin
Ranch Hand

Joined: Apr 24, 2004
Posts: 384
Hello Wise Owen,
Thanks for taking the time to reply. I can't figure out what to change in my code in order for it to work. How do I keep the stub for each httpsession? Can you be so kind as to give me a code sample?
Julien.
wise owen
Ranch Hand

Joined: Feb 02, 2006
Posts: 2023
In processRequest(...)

...
HttpSession session = request.getSession();

pack.AdderWebServiceSEI ws = session.getAttribute("AdderWebServiceSEI");
if (ws == null) {
ws = getAdderWebServiceSEIPort();
session.setAttribute("AdderWebServiceSEI", ws);
}
....
Julien Martin
Ranch Hand

Joined: Apr 24, 2004
Posts: 384
thanks a lot wise owen.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Session maintenance with j2ee generated stub