Sys.Net.WebServiceProxy Class

Provides a way to call a method of a specified Web service asynchronously.

Namespace: Sys.Net

Inherits: None

Name

Description

Sys.Net.WebServiceProxy Constructor

When implemented in a derived class, initializes a new instance of the Sys.Net.WebServiceProxy class.

Sys.Net.WebServiceProxy invoke Method

Calls the specified Web service method.

Sys.Net.WebServiceProxy.defaultFailedCallback Property

Gets or sets the default failed callback function for the service.

Sys.Net.WebServiceProxy.defaultSucceededCallback Property

Gets or sets the default succeeded callback function for the service.

Sys.Net.WebServiceProxy.defaultUserContext Property

Gets or sets the default user context for the service.

Sys.Net.WebServiceProxy.enableJsonp Property

Gets or sets a value that indicates whether the service supports JSONP for cross-domain calls.

Sys.Net.WebServiceProxy.jsonpCallbackParameter Property

Gets or sets a value that specifies the callback function name for a JSONP request.

Sys.Net.WebServiceProxy.path Property

Gets or sets the path to the service.

Sys.Net.WebServiceProxy.timeout Property

Gets or sets the timeout, in milliseconds, for the service.

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 ScriptReference control 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 that derives 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">
  <Scripts>
    <asp:ScriptReference Path="MyScript.js" />
  </Scripts>
</asp:ScriptManager>

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

NoteNote

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.

Show: