Invoking an Operation
The Invoke Operation task enables you to call an operation of any interface during processing of an input, output, or fault path The Invoke activity can choose any operation from any interface in the target interface list.
For example, you can invoke an operation on the input mediation path and use the data in the reply message in subsequent tasks in the input path before the mediation flow invokes the specified target operation.
These examples describe use cases for the Invoke Operation task:
- Invoking a service to retrieve information, such as item price for a purchase order, a zip code for a city, or a shipping quote from a shipping service.
- Coordinating with non-automated processes, such as invoking a service to send an email message after the target operation returns a reply message.
- Basic orchestration with other services, such as invoking an approval service before invoking a target operation to allow a merchandise return.
An invoked operation can be either a one-way or request-response message exchange pattern.
If the invoked operation uses the request-response pattern, the mediation flow suspends execution until a reply is received from the invoked operation. The reply message from an invoked operation is placed in the mediation exchange in an element corresponding to the name of the Invoke Operation task. Subsequent tasks in the path can then access the reply message.
Fault Handling for Invoke Opearations
Faults declared by an operation that an invoke activity references are caught and processed on the fault path. See Fault Processing in a Mediation Flow.
Invoking Operations on Dynamic Interfaces
You can use the Invoke Operation task to invoke operations contained in a dynamic target interface. Dynamic target interfaces require a Set Dynamic Reference task that specifies the actual service to invoke. See Dynamic Requests for more information about dynamic target interfaces.
If the Invoke Operation receives a fault from the target service, the fault flow of the mediation is activated. The Catch Fault task has all target faults that might be generated by all of the invoke tasks, so you can mediate faults that are returned.