Home   |   QuickStart Welcome   |   ASP.NET   |   Web Services   |   How Do I...?   
  |   I want my samples in...      

ASP.NET 2.0 Web Services QuickStart Tutorial

New Event-Based Model For Asynchronous WebMethod Calls

ASP.NET Web Services supports a new model for asynchronous WebMethod calls. Use the event-based model to asynchronously call your Web services. This sample shows how to define your callback function and add it to your proxy class' event handler. When the method call returns, your callback function will be called.

	//First implement the HelloWorldCompleted method using the following signature:
	//public void HelloWorldCompleted(object sender, HelloWorldCompletedEventArgs args)
	//Create the Web service
	HelloWorldWaitService service = new HelloWorldWaitService();
	//Add our callback function to the event handler
	service.HelloWorldCompleted += this.HelloWorldCompleted;
	//Call the Web service asynchronously
	service.HelloWorldAsync("first call");
	//when the Web service call returns the HelloWorldCompleted method will be called

VB Sample Caption
Run Sample View Source

Microsoft .NET Framework SDK QuickStart Tutorials Version 2.0
Copyright � 2004 Microsoft Corporation. All rights reserved.