Best way to consume web service in asp.net code

I am trying to associate a data source with a repeater, such as a web service (.asmx from another site) when the page loads. Webservice returns a DataSet from sql call. What is the best way to do this?

+5
source share
2 answers

Since you are calling to another website, you need to deal with two problems (especially if this web service is located on another website or on the public Internet). Firstly, there may be a delay in retrieving data from another website. Secondly, there may be a timeout on another website.

At a minimum, you should consider an asynchronous page . As the MSDN article says:

If a synchronous request becomes I / O, for example, if it calls a remote web service or requests a remote database and waits for a call to return, then the assigned thread to the request is stuck, doing nothing until the call returns. This impedes scalability because the thread pool has a finite number of threads available. If all request processing threads are blocked, waiting for I / O operations to complete, additional requests in the queue waiting for threads to be free. At best, throughput is reduced because requests take longer to process. In the worst case, the queue fills up and ASP.NET does not work subsequent requests with 503 "Unavailable Server".

, , AJAX. , ajax, . , "" - , -.

+1

-, .

, - , , .

0

All Articles