This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Web Services and the fly likes How to limit webservice calls suppose 50 at a time  while invoking webservice client. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "How to limit webservice calls suppose 50 at a time  while invoking webservice client." Watch "How to limit webservice calls suppose 50 at a time  while invoking webservice client." New topic
Author

How to limit webservice calls suppose 50 at a time while invoking webservice client.

anshu bajpai
Greenhorn

Joined: Jan 02, 2008
Posts: 5
How to limit web service calls suppose 50 at a time while invoking webservice client?
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12761
    
    5
IF you are talking about simultaneous server requests, in Tomcat this is a straightforward setting for the number of request threads and number of pending requests allowed.

IF you are talking about one webservice client making 50 requests, that is a client side programming problem.

Bill
anshu bajpai
Greenhorn

Joined: Jan 02, 2008
Posts: 5
I need the client side sample code where a singleton class (with 50 thread instances )is invoking the client stub method of a particular web service.
Deepika Joshi
Ranch Hand

Joined: Feb 24, 2009
Posts: 268
Message deleted....
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
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.
Best wishes!
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: How to limit webservice calls suppose 50 at a time while invoking webservice client.
 
Similar Threads
Gtting SAXException Bad Types (float -> class java.lang.String)
SOAP Message size
Setting time out for web service call
Anybody handles record paging to prevent OutOfMemoryError?
Invoking webservice from another webservice - Axis2