Scenario: Requesting airport names based on country codes - 6.1

Talend Components Reference Guide

EnrichVersion
6.1
EnrichProdName
Talend Big Data
Talend Big Data Platform
Talend Data Fabric
Talend Data Integration
Talend Data Management Platform
Talend Data Services Platform
Talend ESB
Talend MDM Platform
Talend Open Studio for Big Data
Talend Open Studio for Data Integration
Talend Open Studio for Data Quality
Talend Open Studio for ESB
Talend Open Studio for MDM
Talend Real-Time Big Data Platform
EnrichPlatform
Talend Studio
task
Data Governance
Data Quality and Preparation
Design and Development

This scenario involves two Jobs, one as the data service provider and the other as data service consumer. The former listens to the requests from the consumer via tESBProviderRequest, matches the country code wrapped in the request against a MySQL database table that has the country code/airport pairs via tMap, and finally returns the correct airport name via tESBProviderResponse or if no matches are found, the error message via tESBProviderFault. The Consumer sends requests to the Provider and receives the airport information or error reminders via tESBConsumer.

Building the data service provider to publish a service

The data service airport has already been defined under the Services node of the Repository tree view. Its schema has three major elements as shown below:

For how to define a service in the Studio, see Talend Studio User Guide.

Assigning a Job to the defined service
  1. Right-click getAirportInformationByISOCountryCode under the Web service airport and from the contextual menu, select Assign Job.

  2. In the [Operation Choice] window, select Create a new Job and Assign it to this Service Operation.

  3. Click Next to open the Job description window. The Job name airportSoap_getAirportInformationByISOCountryCode is automatically filled in.

  4. Click Finish to create the Job and open it in the workspace. Three components are already available.

Dropping and linking the components
  1. Drop tXMLMap and tMysqlInput from the Palette to the workspace.

  2. Link tESBProviderRequest to tXMLMap using a Row > Main connection.

  3. Link tMysqlInput to tXMLMap using a Row > Main connection.

  4. Link tXMLMap to tESBProviderResponse using a Row > *New Output*(Main) connection.

    In the new Output name pop-up window, enter the output table name, airport_response.

    Click OK in the pop-up window that asks whether to get the schema of the target component.

  5. Link tXMLMap to tESBProviderFault using a Row > *New Output*(Main) connection.

    In the new Output name pop-up window, enter the output table name, fault_message.

    Click OK in the pop-up window that asks whether to get the schema of the target component.

Configuring the components
  1. Double-click tMysqlInput to display its Basic settings view.

  2. Fill up the basic settings for the Mysql connection and database table.

    Click the [...] button to open the schema editor.

  3. Click the [+] button to add two columns, id and name, with the type of string.

    Click OK to close the editor.

    Click Guess Query to retrieve the SQL query.

  4. Double-click tXMLMap to open its mapper.

  5. In the main : row1 table of the input flow side (left), right-click the column name payload and from the contextual menu, select Import from Repository. Then the [Metadata] wizard is opened.