Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Session maintenance with j2ee generated stub

 
Julien Martin
Ranch Hand
Posts: 384
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 384
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 384
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks a lot wise owen.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic