开发者

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

开发者 https://www.devze.com 2022-12-24 13:56 出处:网络
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)

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  
                                  开发者_如何学Python                                 <---


Did you check Stateful Web Service with JAX-WS RI? The programming model has been reported to be dead simple. Have a look at it.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号