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):
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?
My understanding is yes, and each webservice request will be processed in a separate thread (or thread pool). So you can make the service a singleton but you do need to handle concurrency within your application.
Everything is theoretically impossible, until it is done. ~Robert A. Heinlein