This discussion is archived
1 Reply Latest reply: Apr 7, 2013 2:16 PM by jtahlborn RSS

Jax-ws client can be a singleton?

641285 Newbie
Currently Being Moderated
I 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!

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points