Language

ClientBase.InvokeAsync Method

Definition

Provides support for implementing the event-based asynchronous pattern. For more information about this pattern, see Event-based Asynchronous Pattern Overview.

protected:
 void InvokeAsync(System::ServiceModel::ClientBase::BeginOperationDelegate ^ beginOperationDelegate, cli::array  ^ inValues, System::ServiceModel::ClientBase::EndOperationDelegate ^ endOperationDelegate, System::Threading::SendOrPostCallback ^ operationCompletedCallback, System::Object ^ userState);
protected void InvokeAsync(System.ServiceModel.ClientBase.BeginOperationDelegate beginOperationDelegate, object[] inValues, System.ServiceModel.ClientBase.EndOperationDelegate endOperationDelegate, System.Threading.SendOrPostCallback operationCompletedCallback, object userState);
member this.InvokeAsync : System.ServiceModel.ClientBase<'Channel (requires 'Channel : null)>.BeginOperationDelegate * obj[] * System.ServiceModel.ClientBase<'Channel (requires 'Channel : null)>.EndOperationDelegate * System.Threading.SendOrPostCallback * obj -> unit
Protected Sub InvokeAsync (beginOperationDelegate As ClientBase(Of TChannel).BeginOperationDelegate, inValues As Object(), endOperationDelegate As ClientBase(Of TChannel).EndOperationDelegate, operationCompletedCallback As SendOrPostCallback, userState As Object)

Parameters

beginOperationDelegate
ClientBase.BeginOperationDelegate

A delegate that is used for calling the asynchronous operation.

inValues
Object[]

The input values to the asynchronous call.

endOperationDelegate
ClientBase.EndOperationDelegate

A delegate that is used to end the asynchronous call after it has completed.

operationCompletedCallback
SendOrPostCallback

A client-supplied callback that is invoked when the asynchronous method is complete. The callback is passed to the ClientBase.BeginOperationDelegate.

userState
Object

The userState object to associate with the asynchronous call.

Remarks

Provide a unique value, such as a GUID or hash code, in the userState parameter for each call to InvokeAsync(ClientBase.BeginOperationDelegate, Object[], ClientBase.EndOperationDelegate, SendOrPostCallback, Object), and when each operation is completed, your event handler can determine which instance of the operation raised the completion event.

Applies to