This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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 Android Security Essentials Live Lessons this week in the Android 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.
 
Consider Paul's rocket mass heater.
 
subject: Session maintenance with j2ee generated stub
 
Similar Threads
Soap & attachments: encoded or literal??
don't understand this: The service interface does not implement javax.xml.rpc.Service
Pls clarify my SESSION problem, thanks (technical knowledge)
Pls clarify my SESSION problem, thanks (technical knowledge)
following problem: The service interface does not implement javax.xml.rpc.Service