Invoking a service through HTTP or HTTPS using custom extension
The custom extension that you configure to invoke a service through HTTP or HTTPS can be enforced in any of the policy stages and used during API processing.
Procedure
- Ensure you have the external endpoint URL to be invoked during API processing using a custom extension.
- Open the menu options and select APIs.
- Click the required API. The API details page appears.
- Click Edit.
- Select Policies.
- Click Required Policy stage > Custom Extension. This adds the custom extension policy where you can configure the required properties.
- Click Open in full-screen to open the policy properties section in a full page.
- Provide the following information in the Conditions section, as
required:
Parameter Description Condition Conditions are used to specify when the policy has to be executed. We can add multiple conditions with logical operators. . Available values are:
- AND. webMethods API Gateway executes this policy when all the configured conditions comply in the respective policy stage.
- OR. This is selected by default. webMethods API Gateway executes this policy when
any one of the configured conditions complies.
Click Add Condition and provide the following information and click Add.
- Variable. Specifies the variable type with a syntax.
- Operator. Specifies the operator to use to relate variable and the value.
You can select one of the following:
- Equal
- Equals ignore case
- Not equals
- Not equals ignore case
- Contains
- Exists
- Greater Than
- Less Than
- Value. Specifies a plain value or value with a syntax.
For details about the variables available in webMethods API Gateway, see Variable Framework .
- Click Custom Action.
- Select External endpoint in the custom extension Type field.
- Provide the following information in the External Endpoint section,
as required:
Property Description Endpoint URI Provide the external endpoint URI that you want to invoke. Method Specify the method exposed by the API. Available values are PUT, POST, GET, DELETE, HEAD, CUSTOM. Note: If you select CUSTOM, the HTTP method in the incoming request is sent to the native API.SSL Configuration Specifies the required SSL configuration details of the external endpoint. Provide the following information: - Keystore Alias. Specifies the keystore alias. For details on Keystore configuration, see Configuring keystore information .
- Key Alias. Specifies the alias for the private key, which must be stored in the keystore specified by the keystore alias.
- Truststore Alias. Specifies the alias for the truststore. For details on Truststore configuration, see Configuring truststore information.
- HTTP Connection Timeout (seconds). Specifies the time interval (in seconds) after which a connection attempt to the external endpoint URL times out.
- Read Timeout (seconds). Specifies the time interval (in seconds) after which a socket read attempt times out.
Path Parameters Specifies the path parameter you want to configure to your custom extension. Provide the following information: - Path Parameter Name. Specifies the name of the path parameter you want to
configure in your custom extension. This path parameter name should be present in the endpoint URL
enclosed with {} to be replaced at runtime. For example, define external URL as
http://host/authors/{id}/
books and provide id as path parameter name with the value you need to populate at runtime. - Path Parameter Value. Specifies the value for the path parameter specified.
- Configure the custom properties of the custom extension as required. For details about the custom extension properties and their descriptions, see Custom extension properties .
- Click Save. The API is saved with the added custom extension.
- Invoke the API. The applied custom extension invokes the mentioned HTTP/HTTPS endpoint and processes as configured.