How to (simply) create new service objects in java jax-ws webservices?
- by cibercitizen1
Is it possible in jax-ws to have a webmethod that creates a new object (of a service class)
and returns a reference to it to the client caller (for the client, it's a remote reference)
so that the client and this new service object maintain a session?
(Therefore each client is served by a different instance).
Schematically:
client                                   server                    o:Session
--------                                 --------                  ----------
    s = server.access() ------------------>         
                                            o = new Session()
                                            return o
                                         <---
    o.doSomething() ---------------------------------------------->
                                                                     make it  
                                                                   <---
    o.doMore()  --------------------------------------------------> 
                                                                    make it  
                                                                   <---