In a database i have 30k users, each with a specified phonenumber. For each phonenumber, I will call a webservice which pulls some information for the user. Many users are not presented in the webservice, so I will just recieve null, but I don’t know which users, and new users can be presented from time to time. The webservice updates realtime, so new results will come from minute to minute.
If the response is not null, and the recieved file is not the same as received last time, I create a PDF document from the recived XML-file.
The webservice call is started by a scheduled task which starts an .aspx-site with the following pseudo-code:
Foreach phonenumber {
HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create("webservice/phonenumber");
using (StreamReader reader = new StreamReader(webResponse.GetResponseStream()))
{
makePdf();
}
}
The problem is, of course, that the request takes forever. For 30k users it would take about 7 hours. I have tried looking at async webservice calls, but couldn’t get anything to work. Can someone point me in the right direction – if possible -, or tell me how I should go about this?
Thanks
First you should check if the time is in the webservice or in the PDF creation. If it is in the webservice, check if you are missing indexes, etc. To improve the webserice you can thing of getting multiple phonenumbers at the same time. If your problem is in the PDF creation, find a way to improve the creation of the pdfs. It’s not clear what tools you are using to create a pdf at this moment.