• 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
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

Session maintenance with j2ee generated stub

 
Ranch Hand
Posts: 384
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 2023
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks a lot wise owen.
 
reply
    Bookmark Topic Watch Topic
  • New Topic