Jax-ws client can be a singleton?
641285Apr 7 2013 — edited Apr 7 2013I have to call a webservice using JAX-WS and I have to include a parameter in header of webservice xml. I've used wsimport to generate client classes and now I'm using them in this way (I use MyHandlerResolver to inject parameter in header):
MyServiceService myServiceService = new MyServiceService(url, new QName("http://mysite/service", "MyServiceService"));
MyHandlerResolver handlerResolver = new MyHandlerResolver();
myServiceService.setHandlerResolver(handlerResolver);
MyService myService = myServiceService.getMyServicePort();
*((BindingProvider) myService).getRequestContext().put("myParameter", myParameter);*
myService.callSomeMethod();
My question is: can MyServiceService be a singleton? Are there issues with concurrent requests? I haven't found any clear answer on this argument. Is there any official documentation about this?
Thanks!