aspose file tools*
The moose likes Web Services and the fly likes Jax-ws client can be a singleton? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Jax-ws client can be a singleton?" Watch "Jax-ws client can be a singleton?" New topic
Author

Jax-ws client can be a singleton?

Matteo Ferrari
Greenhorn

Joined: Apr 07, 2013
Posts: 1
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?
Thanks!
Tina Smith
Ranch Hand

Joined: Jul 21, 2011
Posts: 177
    
    6

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
Tina Smith
Ranch Hand

Joined: Jul 21, 2011
Posts: 177
    
    6

And welcome to the ranch!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Jax-ws client can be a singleton?