as of JAX-WS 2.0, there is no supprt for stateful sessions. In JAX-WS 2.1, there is a concept of stateful webservices which is done through ws-addressing.
I would not recommend serializing the Handle object, if need be make a representation (or key) of the handle and pass that to the WS client. Each time that key is returned, you can used that to look up the handle.
In fact, I don't even think its possible.
You can mimick a session by defining the lifecycle of a session (starts at login, ends at logout). Of course, you would have to persist/maintain state on the server side.
Dwin is right. WS-Addressing is the right way to build conversational web services. Take a look at the user guide and the corresponding samples. It contains an example for a staful service. It's already supported for quiet some time now:
IMO passing the serialized handle around is not a good idea. I could picture a SLSB facade instead that keeps a UUID->Handle registry and delegates to the SFSB beans behind the scenes. You could hand out the UUID using WS-Adressing and internally rely on the ejb handle. You could even offer a simple API for clients to resign from their sessions.
THANK YOU VERY MUCH, Dwin and Heiko!!!
I will follow your suggestions and check WS-Adressing.