File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Web Services and the fly likes accessing SessionID from SOAP call Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "accessing SessionID from SOAP call" Watch "accessing SessionID from SOAP call" New topic

accessing SessionID from SOAP call

Ste Lamb

Joined: Feb 05, 2003
Posts: 14
Hello again...
I'm currently using JDeveloper and Oracle9iAS. I have an applet which calls a stateful EJB via a web-service (stateful class).
When creating the SOAP calls a session ID is sent as part of the calls - does anyone know of a way to access this session ID? I've found getters and setters for the session ID in the Oracle documentation but there doesn't seem to be a way to use this given the only link I have with the session is the HTTP connection.
No doubt I'm missing something obvious as usual but any help much appreciated.
Kyle Brown
Ranch Hand

Joined: Aug 10, 2001
Posts: 3892
First of all, a design point. A stateful Web Service is a really, really bad idea. I wouldn't do that if I were you -- it misses the point of the Web Services specifications, which are supposed to be stateless.
Second, there is a way to do this in JAX-RPC. I'm not sure which SOAP engine you are using, but if it supports JAX-RPC it can be done -- look through the JAX-RPC specification.

Kyle Brown, Author of Persistence in the Enterprise and Enterprise Java Programming with IBM Websphere, 2nd Edition
See my homepage at for other WebSphere information.
Ste Lamb

Joined: Feb 05, 2003
Posts: 14
Using the stateful web-service wasn't my method of choice but I couldn't find a way around the problem. Basically I have to talk to a stateful bean thorugh a SOAP connection. I am using the Oracle SOAP methods and this does not allow you to talk to a stateful bean directly using SOAP. Hence I have had to put a simple class in between the client and bean.
My experience isn't such that I could find a better way to do this.... given time restrictions etc..(isn't that always the way???). Suggestions on a better way would be much appreciated for future reference.
Also, why is a stateful web-service such a bad idea? Surely if its correctly managed its not a problem...
Thanks for your advice I'll look into the JAX-RPC specification...
I agree. Here's the link:
subject: accessing SessionID from SOAP call