Adding session variables to a JAX-RPC SOAP POJO?

S

Scott Balmos

Hi all,

Sorry for the mess of acronyms in the subject. I've got a few POJO-type
services exposed as SOAP web services via JAX-RPC in JBoss. The problem
is, my service needs to enable session-level persistence and the
ability to store session variables, cookies, etc.

Normally, IIRC, this would be handled by some methods in the
HttpRequest object, if this was a normal servlet. But since this is a
POJO, I never see the HttpRequest object. The POJO code Just Seems To
Run [tm].

Any pointers on how to handle this? I hope I'm not SOL using this
system of writing a web service. For reference, I'm using JBoss 4.0.2

Thanks!

--Scott
 
S

Steve W. Jackson

Scott Balmos said:
Hi all,

Sorry for the mess of acronyms in the subject. I've got a few POJO-type
services exposed as SOAP web services via JAX-RPC in JBoss. The problem
is, my service needs to enable session-level persistence and the
ability to store session variables, cookies, etc.

Normally, IIRC, this would be handled by some methods in the
HttpRequest object, if this was a normal servlet. But since this is a
POJO, I never see the HttpRequest object. The POJO code Just Seems To
Run [tm].

Any pointers on how to handle this? I hope I'm not SOL using this
system of writing a web service. For reference, I'm using JBoss 4.0.2

Thanks!

--Scott

I'm not entirely certain of any of this -- so take it with that in mind.
But I also have a JAX-RPC web service, though I've never used JBoss. In
my case, for reasons I don't recall just now, I elected to have my main
class implement the javax.xml.rpc.server.ServiceLifecycle interface.
According to its JavaDocs, it defines a lifecycle interface for a
JAX-RPC service endpoint -- which is what my main class is. It contains
init() and destroy() methods I had to implement. The init method has
one parameter: Object context. Per the JavaDocs, this method is
invoked after instantiation by the JAX-RPC runtime system. It says that
the context parameter should be typecast to an appropriate Java type,
but for service endpoints deployed on a servlet container based JAX-RPC
runtime system it'll be javax.xml.rpc.server.ServletEndpointContext.
That interface has methods for accessing HttpSession and ServletContext
which may be helpful to your cause.

HTH.

= Steve =
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top