My Web Service uses another API to obtain data. I cache the data, clean it and return it do the user when they make a request. At the moment I am getting a lot of requests and because I can only access the data API 2 times per second, I am getting errors back which means some users don't get the data and other do.
What I want to do is add each request to a queue and process them 1 by one with a 0.4 second sleep between them. he queue would have to be running all the time to make sure that all request are processed.
How would I do this in ASP.NET 3.5?
Briefly, I suggest you create a Windows Service to process an MSMQ queue. Your existing web service would put requests into that queue.
However, your service will need to become an asynchronous web service. This way, while "waiting" for a response, your service will not be blocking a request thread.
BTW, are you using ASMX web services or WCF services? This will determine how to make the service asynchronoous.