Sys.Data.AdoNetServiceProxy.invoke method

Executes a method that is exposed by the data service.

invoke: function(operationUri, httpVerb, parameters, succeededCallback, failedCallback, userContext, webRequest)

Usage

exampleDataService.invoke(operationUri, httpVerb, parameters, succeededCallback, failedCallback, userContext, webRequest);

Parameters

Parameter

Definition

operationUri

The path of the operation to invoke.

httpVerb

(Optional) The HTTP verb to use for this service call.

parameters

(Optional) A dictionary of parameters to pass to the service method. To create this dictionary, use the Sys.Data.AdoNetInvokeParametersBuilder class.

succeededCallback

(Optional) The function to execute when the operation succeeds.

failedCallback

(Optional) The function to execute when the operation fails.

userContext

(Optional) The state object for this operation.

webRequest

(Optional) The Sys.Net.WebRequest object to use for the Web request instead of the default Web request object.

Return Value

The Sys.Net.WebRequest object that performed the operation.

Remarks

Use the invoke method to execute a method of the data service.

The signatures for the callback functions must match the following examples:

function callbackSucceeded(result, context, operation)

function callbackFailed(error, context, operation)

The functions that you assign to the callback functions must accept three parameters. The first parameter contains the result (or error) that is returned by the data service. The second parameter contains the state object for the data operation. The third parameter contains a description of the operation that was performed. When you invoke an operation, the third parameter contains the value that was passed in the operationUri parameter.

If you do not provide a value for the webRequest parameter, the AdoNetServiceProxy class creates a new instance of the Sys.Net.WebRequest class.

See Also

Other Resources

Sys.Data.AdoNetServiceProxy Class

Using ASP.NET AJAX to Access ADO.NET Data Services