When writing applications that consume Web services, you inevitably must deal with the latency involved when making calls across a network. In certain situations, particularly on a private network with plenty of bandwidth, calls can complete in half a second or less and the wait isn't particularly significant. However, if you are sending requests to a remote location across the Internet, or are making calls that require a lot of processing time, then you need to start thinking about how lengthy delays can affect your application. Microsoft® Windows® Forms applications, for instance, may appear frozen while they wait for a call to a Web service to return. If you are calling a Web service from a Microsoft® ASP.NET page, you may find that multiple Web service calls make your page display many times slower. If you have an application that is making many Web service calls, then it's important to think about how to call them as efficiently as possible.
The solution to a lot of these problems is to make your Web service calls asynchronously. Asynchronous calls return immediately and then use some other mechanism for indicating when the call actually completes. This will allow your application to do other things, like any background processing that may be required, responding to user interactions with the UI, providing feedback about the current state of the request, or even initiating other Web service calls. We will be taking a look at how the Microsoft® .NET Framework provides support for making asynchronous Web service calls over HTTP, and how we might use them in a couple of common scenarios.