The Callout Mediator performs a blocking invocation of an external service during mediation. The service URL and the optional action specify the parameters for this external call.
As the Callout Mediator performs a blocking call, it cannot use the default non-blocking HTTP/S transports based on Java NIO. Instead, it defaults to using
<ESB_HOME>/repository/conf/axis2/axis2_blocking_client.xml as the Axis2 configuration and
<ESB_HOME>/repository/deployment/client as the client repository unless these are specified separately.
To add the Callout mediator to a sequence, click Add Child at the point in the sequence tree where you want to add the mediator, and then choose Advanced -> Callout.
Following are the properties you set for the Callout mediator:
- ServiceURL - URL of the service you are calling.
- Action - SOAP action to append to the service call.
- Axis2 Repository - Full path to Axis2 client repository where the services and modules are located.
- Axis2 XML - Full path to Axis2 XML configuration file location.
- Source - Specifies the payload for the request message. You can specify the source as follows:
- Target - Specifies the node or property where the resulting payload will be attached to the current message. You can specify the target as follows:
- XPath - An expression that defines the location in the message. You can click Namespaces to map namespaces to prefixes that you use in your expression.
- Key - A registry key in the Configuration Registry or Governance Registry that defines the property that will contain the resulting payload and be added to the current message context.
You can also configure the mediator using XML by clicking switch to source view in the Mediator window.
In this example, the Callout Mediator does the direct service invocation to the
StockQuoteService using the client request, gets the response, and sets the response as the first child of the SOAP message body. You can then use the Send Mediator to send the message back to the client.