The The Callout mediator mediator performs a blocking external service invocation during mediation.
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 using <ESB_HOME>/repository/conf/axis2/axis2_blocking_client.xml
as the Axis2 configuration, and and <ESB_HOME>/repository/deployment/client
as the client repository unless these are specified separately.
Tip |
---|
The Call mediator leverages the non-blocking transports for much greater performance than the Callout mediator, so you should use the Call mediator in most cases. However, the Callout mediator is recommended in situations where you need to execute the mediation flow in a single thread. |
...
Table of Contents | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
...
Setup
Enabling mutual SSL
Since the Callout mediator is run based on the configuration of the axis2the axis2_blocking_client.xml
file file, its default https transport sender is org.apache.axis2.transport.http.CommonsHTTPTransportSender
. Therefore, the Callout mediator does not have access to the required key store to handle mutual SSL. To enable the Callout mediator to handle mutual SSL, the following JVM settings should be added to the <ESB_HOME>/bin/wso2server.sh
file file.
Code Block | ||
---|---|---|
| ||
-Djavax.net.ssl.keyStore="$CARBON_HOME/repository/resources/security/wso2carbon.jks" \ -Djavax.net.ssl.keyStorePassword="wso2carbon" \ -Djavax.net.ssl.keyPassword="wso2carbon" \ |
Tip |
---|
The Call mediator leverages the non-blocking transports for much greater performance than the Callout mediator, so you should use the Call mediator in most cases. However, the Callout mediator is recommended in situations where you need to execute the mediation flow in a single thread. |
Info |
---|
The Callout mediator is a content-aware mediator. |
Table of Contents | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Disabling chunking
Anchor | ||||
---|---|---|---|---|
|
The Callout mediator is not affected by the DISABLE_CHUNKING property. Instead, you can disable chunking for the Callout mediator by setting the Transfer-Encoding
parameter to none
in CommonsHTTPTransportSender of axis2_blocking_client.xml
as follows:
<parameter name="Transfer-Encoding">none</parameter>
For example:
Code Block | ||
---|---|---|
| ||
<transportSender name="http"
class="org.apache.axis2.transport.http.CommonsHTTPTransportSender">
<parameter name="PROTOCOL">HTTP/1.1</parameter>
<parameter name="Transfer-Encoding">none</parameter>
<parameter name="cacheHttpClient">true</parameter>
<parameter name="defaultMaxConnectionsPerHost">200</parameter>
</transportSender> |
This will disable chunking for all Callout mediators present in the ESB server.
If you want to disable chunking for only a single Callout mediator instance, create a new axis2.xml
file by copying the axis2_blocking_client.xml
file, set the Transfer-Encoding
parameter as shown, and then configure that Callout mediator to use this new axis2.xml
file as described below.
...
Syntax
Code Block | ||||
---|---|---|---|---|
| ||||
<callout [serviceURL="string"] [action="string"] [initAxis2ClientOptions="true|false"] [endpointKey="string"]> <configuration [axis2xml="string"] [repository="string"]/>? <source xpath="expression" | key="string" | type="envelope"/> <target xpath="expression" | key="string"/> <enableSec policy="string" | outboundPolicy="String" | inboundPolicy="String" />? </callout> |
...
Parameter Name | Description | |||||
---|---|---|---|---|---|---|
Specify As | This parameter determines whether the target external service should be configured by using either a
If neither a URL or an address endpoint is specified, the | |||||
URL | If you selected URL for the Specify As parameter, use this parameter to enter the URL of the external service that you want to call. This URL will be used as the End Point Reference (EPR) of the external service. | |||||
Address Endpoint | If you selected Address Endpoint for the Specify As parameter, use this parameter to enter key to access the endpoint that should be used to call the external service. Click Configuration Registry or Governance Registry as relevant to select the required endpoint from the resource tree. | |||||
Action | The SOAP action which should be appended to the service call. | |||||
Axis2 Repository | The path to Axis2 client repository where the services and modules are located. The purpose of this parameter is to make the Callout mediator initialize with the required client repository. | |||||
Axis2 XML | The path to the location of the Axis2.xml configuration file. The purpose of this parameter is to make the Callout mediator initialize with the relevant Axis2 configurations. | |||||
initAxis2ClientOptions | If this parameter is set to false , the existing Axis2 client options available in the Synapse message context will be reused when the Callout mediator is invoked. This is useful when you want to use NLTM authentication. The default value for this parameter is true . | |||||
Source | This parameter defines the payload for the request. It can be defined using one of the following options.
| |||||
Target | The node or the property of the request message to which the payload (resulting from the value specified for the Source parameter) would be attached. The target can be specified using one of the following options.
| |||||
WS-Security | If this check box is selected, WS-Security is enabled for the Callout mediator. This section would expand as shown below when you select this check box. | |||||
Specify as Inbound and Outbound Policies | If this check box is selected, you can define separate security policies for the inbound and outbound messages (flows). This is done by entering the required policy keys in the Outbound Policy Key and Inbound Policy Key parameters which are displayed as follows when this check box is selected. You can click Configuration Registry or Governance Registry to select a security policy saved in the Registry from the resource tree. | |||||
Policy Key | If the Specify as Inbound and Outbound Policies check box is not selected, this parameter is used to enter a key to access a security policy which will be applied to both inbound and outbound messages. You can click Configuration Registry or Governance Registry to select a security policy saved in the Registry from the resource tree. |
...