How to (simply) create new service objects in java jax-ws webservices?

Posted by cibercitizen1 on Stack Overflow See other posts from Stack Overflow or by cibercitizen1
Published on 2010-03-26T11:17:59Z Indexed on 2010/03/26 11:23 UTC
Read the original article Hit count: 269

Filed under:
|
|
|

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  
                                                                   <---

© Stack Overflow or respective owner

Related posts about java

Related posts about jax-ws