Webservice - client service instantiation

后端 未结 2 1232
面向向阳花
面向向阳花 2021-02-07 13:27

Do you know how costly is to create a webservice client service instance ?

 JavaWebService service = new JavaWebService();
 SomePort port = service.getJavaWebSer         


        
2条回答
  •  忘了有多久
    2021-02-07 14:19

    If you are using jax-ws, then you cannot share a port across threads (they are not thread-safe). if you are concerned about the overhead of creating a port (and have measured it and confirmed that it is a bottleneck in your application), then you could create a connection pool of ports.

提交回复
热议问题