Documentation for: ASP.NET Ajax Version 1.0

This documentation is for a previous version. For the current released version, see the ASP.NET Ajax documentation on MSDN.

 

 

 

 

 

 

 

Generated Proxy Classes

Introduction

Enables your application to call Web services asynchronously by using ECMAScript (JavaScript).

Namespace: Sys.Net

Inherits: None

Constructors

Name

Description

Proxy Classes Constructor

Creates a new instance of the generated proxy class.

Members

Name

Description

Methods

Invoke the corresponding Web service methods.

defaultFailedCallback Property

Gets or sets the default failed callback function for the generated proxy class and its instances.

defaultSucceededCallback Property

Gets or sets the default succeeded callback function for the generated proxy class and its instances.

defaultUserContext Property

Gets or sets the default user context for the generated proxy class and its instances.

path Property

Gets and sets the Web service URL.

timeout Property

Gets or sets the time-out interval for the generated proxy class and its instances.

Failed Callback Function

Processes error information after a Web service method request has failed.

Succeeded Callback Function

Processes returned data after the Web service method request returns successfully.

Remarks

To invoke a method of a Web service, you call the corresponding method of the generated Web service proxy class. The generated proxy class executes a Web request to the Web service method.

note

For ASP.NET AJAX applications to call Web services from script, the application must be configured to register the required ASP.NET HTTP handler. For more information, see Exposing Web Services to Client Script.

The Web service that you are calling must be an .asmx file and must be qualified with the ScriptServiceAttribute attribute. Individual methods to be called from script must be qualified with the WebMethodAttribute attribute. Methods without this attribute are not exposed in the proxy class. For more information, see Exposing Web Services to Client Script and Calling Web Services from Client Script.

The proxy class is automatically generated when the ASP.NET Web page is rendered and is derived from the Sys.Net.WebServiceProxy class. The path property of the generated class references the Web service URL.

In your application, you can call the generated proxy class members. Alternatively, you can create instances of the generated proxy class. You can specify a succeeded callback function, a failed callback function, and, optionally, time-out value and user context as default properties for each instance. You can then use these proxy class instances to call Web service methods.

Example

The following code example shows how to use a Web service generated proxy class and a related service proxy instance.