Configuring tXMLMap - 7.1

Data Service and Routing Examples

author
Talend Documentation Team
EnrichVersion
7.1
EnrichProdName
Talend Data Fabric
Talend Data Services Platform
Talend ESB
Talend MDM Platform
Talend Open Studio for ESB
Talend Real-Time Big Data Platform
task
Design and Development > Designing Routes
Design and Development > Designing Services
EnrichPlatform
Talend Studio

Procedure

  1. On the workspace, double click tXMLMap to open its editor. At this moment, the editor should look like:
  2. In the main row table of the input flow side (left), right-click the column name payload and from the contextual menu, select Import from Repository. Then the Metadatas wizard is opened.
    For more information on how to create the XML tree, see the Using the document type to create the XML tree section of the Talend Studio User Guide.
  3. Expand the File XML node in this wizard, select the schema of the request side and click OK to validate this selection. In this example, the schema is getAirportInformationByISOCountryCode.
  4. Do the same to import the hierarchical schema for the response side (right). In this example, this schema is getAirportInformationByISOCountryCodeResponse.
  5. Then to create the join to the lookup data, click the CountryAbbrviation node in the main row of the input side (left), hold and drop it onto the Exp.key column of the lookup flow, corresponding to the id row.
  6. On the table representing the lookup flow, click the wrench icon on the up-right corner to open the setting panel.
  7. Set Lookup Model as Reload at each row, Match Model as All matches and Join Model as Inner join.
    For more information about Lookup Model, see the Handling Lookups section of the Talend Studio User Guide.
    For more information about Match Model, see the How to use Explicit Join section of the Talend Studio User Guide.
    For more information about Join Model, see the How to use Inner Join section of the Talend Studio User Guide.
    A step-by-step tutorial related to this Join topic is available on the Talend Technical Community Site. For further information, see http://talendforge.org/tutorials/tutorial.php?language=english&idTuto=101.
  8. Do the same to open the setting panel on the output side (right) and set the All in one option as true. This ensures that only one response is returned every time when one request is sent, as, otherwise, the airport data from the given database may provide several airports, thus several responses, to each country code that you send as one request.
    For more information about All in one, see the How to output elements into one document section of the Talend Studio User Guide.
  9. Click the name row in the lookup flow (left), hold and drop it onto the Expression column corresponding to the tns:getAirportInformationByISOCountryCodeResult node in the XML tree view of the output flow (airport_response in this example).

    Then your tXMLMap editor should look like:

    Note:

    In the real-world practice, you can as well add hierarchical data for lookup.

  10. Click OK to close the editor and validate this configuration.