Take a look at java.util.concurrent.ThreadPoolExecutor.
1) If you need max 50 threads at the same time to invoke a web service, then set the number of threads in the executor to 50.
2) If you need to limit the total number of invocations of the web service to 50, then create a subclass of ThreadPoolExecutor in which you override the execute method. In your execute method, you check if the total number of submitted tasks is less than 50, before accepting a new task.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
subject: How to limit webservice calls suppose 50 at a time while invoking webservice client.