CIS 573 Demo of Async Call to a (Slow) Web Service

Last modified 08/07/2006

This sample program is a Windows application (client) calling an XML web service (server) which resides on a remote machine.   The remote procedure call "plumbing" is handled entirely by Visual Studio .NET simply by specifying the URL of the web service information page.

The Quote web service URL is:
   http://harbormist.com/webservice/Quote/Quote.asmx

The SlowQuote web service URL (with deliberate 2 second delay) is:
   http://harbormist.com/webservice/SlowQuote/Quote.asmx

Here's the server source code (NOTE: it uses a database!)

Here's the client code, and also the client project for download (slightly enhanced from class).  The third button (bottom one in the screen shot below) returns control immediately to the form, keeping the user interface responsive even though the web service takes at least 2 seconds to complete it's work.  The web service then "calls back" the event handler in the form to provide the answer:


 

Visitors: Hit Counter