Configuring the ESB REST Client connector

Talend Connectors for BPM Reference Guide

EnrichVersion
6.2
task
Design and Development
EnrichPlatform
Talend Studio

To configure the Talend REST Client connector, proceed as follows:

  1. If you have not added the connector, select the Talend ESB REST Client connector from the connector list;

    If you have already added it to the process or a task of the process, select the connector and click Edit in the Connectors tab of the General view for the process or task.

    A configuration wizard opens to guide you through the configuration.

  2. Complete the following information and click Next to go to the next step.

    Field / option

    Description

    Name *

    Name of the connector.

    Description

    Description of the connector.

    Select event *

    Event that triggers the connector:

    • enter - event occurs when the flow enters this process step;

    • start - event occurs when the flow starts;

    • suspend/resume - event occurs when the user presses the suspend/resume button on the web-form;

    • finish - event occurs when the flow exits this process step

    If connector fails...

    Action to take if the connector fails consuming the Web service:

    • Put in failed state - puts the step in failed state and terminates the process;

    • Ignore error and continue process - continues the process ignoring the error;

    • Throw error event - throws a user-specified error.

    Named Error

    Specifies the name of the error which should be thrown if the connector fails. Available only if the Throw error event option is selected.

    Note

    Fields followed by an asterisk (*) are required.

  3. The following step of the wizard allows you to define the properties of the REST service to be called from within the process.

  4. Fill in the following information and click Next to go to the next step.

    Field / option

    Description

    Endpoint URL

    URL of the REST service to be invoked. When the Use Service Locator check box is selected on the next page of this wizard, this field is not used and the URL of the REST service will be obtained from the Service Locator server automatically.

    Relative Path

    Relative path of the REST service to be invoked.

    If Use Service Locator is disabled: You can enter any of the first part of the address in the Endpoint URL field, and the second part in the Relative Path field.

    If Use Service Locator is enabled: The URL part will be given by the Service Locator. In this case, you need to know the URL part, and specify the rest part in Relative Path. This depends on the service you request.

    Method

    From this list, select an HTTP method that describes the desired action. The specific meanings of the HTTP methods are subject to definitions of your Web service provider. Listed below are the generally accepted HTTP method definitions:

    - GET: retrieves data from the server end based on the given parameters.

    - POST: uploads data to the server end based on the given parameters.

    - PUT: updates data based on the given parameters, or if the data does not exist, creates it.

    - DELETE: removes data based on the given parameters.

    Accept Type

    Select the media type the client end is prepared to accept for the response from the server end.

    Available options are XML, JSON, and ANY. When ANY is selected, the response message can be of any type and will be transformed into a string.

    Query

    Specify the URI query parameters in the form of name-value pairs.

    This option is mostly used with the GET method.

    Request

    This option is required only when the POST or PUT HTTP method is selected.

    Content Type: Select XML, JSON, or FORM according to the media type of the content to be uploaded to the server end.

    Request: Payload of the request message.

    Security

    Use Security: Select this check box if authentication is required on the REST server end. Once selected, you need to provide your username and password.

    Security Type: choose a security type between Basic HTTP and Digest.

    Headers

    Type in the name-value pair(s) for HTTP headers to define the parameters of the requested HTTP operation.

    Timeouts

    Connection timeout: Set the amount of time, in seconds, that the client will attempt to establish a connection before it times out. If set to 0, the client will continue to attempt to open a connection indefinitely. (default: 30)

    Receive timeout: Set the amount of time, in seconds, that the client will wait for a response before it times out. If set to 0, the client will wait indefinitely. (default: 60)

  5. This step allows you to use or not the Talend ESB Infrastructure services for this consumer request.

  6. Fill in the following information and click Next to go to the next step.

    Feature

    Field / option

    Description

    Service Locator

    Use Service Locator

    Select this check box to enable the Service Locator feature.

    With this feature enabled, the provider endpoint (URL) will be requested at runtime from the Talend ESB Service locator. In this way, the process is loosely coupled to the provider so the provider can be used based on availability, regardless of where they are hosted.

     

    Service Name

    Name of the service to be invoked.

     

    Service Namespace

    Namespace of the service to be invoked.

     

    Service Locator Properties

    Optional: additional metadata can be set as a filter for the list of service providers. For example, if the provider uses a locationmetadata to specify the data center location they are running with (values EU and US for example), a row in this table with 'locator' values EU would only retrieve an endpoint where the provider is located in a EU data center.

    Service Activity Monitoring

    Use Service Activity Monitoring

    Select this check box to enable monitoring the service calls with Service Activity Monitoring. In this way, request from the process to a ESB Provider is also tracked as a Service Activity event.

     

    Service Activity Monitoring Custom Info

    The table allows you to provide additional user-defined metadata which is stored together with the Service Activity Event.

    Business Correlation

    Use Business Correlation

    Select this check box to enable the Business Correlation feature. This will pass a correlation ID to the service it calls via the request HTTP header, so that chained service calls will be grouped under this correlation ID.

    With this feature enabled, the connector will also extract the correlation ID from the response HTTP header and store it in the process variable specified in the next step for further use in the process.

     

    Correlation ID

    Specify your correlation ID or select a process variable for your correlation ID to pass to the service the connector calls. If you leave this field empty, a random UUID will be generated automatically at runtime.

  7. Set the parameters as follows to map the Web service response to variables/data types of the process, and then click Finish.

    Field

    Description

    Connector output

    Allows you to select the connector output or its part for storing it in the specified variable. The list also allows you to open a dialog box which provides a structured view of the response parameter.

    Destination variable

    Variable where the connector output should be stored. With the Create data... option, you can create new process variables within this dialog box.