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.








Sys.Net.WebServiceProxy Class


Enables calling a method of a specified Web service asynchronously.

Namespace: Sys.Net

Inherits: None




invoke Method

Calls the specified Web service method.


The only time that you use the Sys.Net.WebServiceProxy class directly is when the Web service path is not known in advance. In that case, you cannot set the Path attribute of the <asp:ScriptReference> element in the page. A typical example is if a control binds to a Web service at run time.

Normally, you do not instantiate the WebServiceProxy class directly. Instead, you use a proxy class derived from it. This proxy class is generated as a result of including a Web service reference in a page, as shown in the following example:

<asp:ScriptManager runat="server" ID="ScriptManager1">
    <asp:ScriptReference Path="MyScript.js" />

Each generated proxy class method calls the invoke method to call the related Web service method.


Invoking a proxy method from a JavaScript function performs an asynchronous Web request that invokes the corresponding Web service method. When the request returns, the appropriate JavaScript callback function is called.