Delen via


Using the CallExternalMethodActivity Activity

The CallExternalMethodActivity activity and the HandleExternalEventActivity activity can be used for input and output communications with a local service. You can use these activities directly for generic communications, or you can derive from the CallExternalMethodActivity and HandleExternalEventActivity classes to create activities that are strictly bound to specific events and methods on an interface that is attributed with the ExternalDataExchangeAttribute attribute.

The base CallExternalMethodActivity class invokes the method specified by the InterfaceType and MethodName properties on the corresponding local service that is registered with the WorkflowRuntime. This invocation is performed synchronously with the arguments gathered from the ParameterBindings collection of bound locations. If the method has return values, they are set to the bound locations just before the activity finishes executing.

For more information about the CallExternalMethodActivity activity, see Generating Communication Activities, Using Local Services in Workflows and the CallExternalMethodActivity class of the System.Workflow.Activities namespace in the Windows Workflow Foundation Class Library reference.

For code samples that demonstrate how to use the CallExternalMethodActivity activity, see Raise Event To Load Workflow or the samples in Communications Samples.

See Also

Reference

CallExternalMethodActivity
HandleExternalEventActivity
ExternalDataExchangeAttribute

Concepts

Generating Communication Activities
Using Local Services in Workflows

Other Resources

Windows Workflow Foundation Activities