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.