Configuring the body of the response

ESB REST

author
Talend Documentation Team
EnrichVersion
6.4
EnrichProdName
Talend ESB
Talend Big Data Platform
Talend MDM Platform
Talend Data Services Platform
Talend Real-Time Big Data Platform
Talend Data Management Platform
Talend Data Integration
Talend Open Studio for Data Integration
Talend Data Fabric
Talend Open Studio for MDM
Talend Open Studio for ESB
Talend Big Data
Talend Open Studio for Big Data
task
Data Quality and Preparation > Third-party systems > ESB components > ESB REST components
Data Governance > Third-party systems > ESB components > ESB REST components
Design and Development > Third-party systems > ESB components > ESB REST components
EnrichPlatform
Talend Studio

Procedure

  1. Connect tRESTRequest to tXMLMap using the Row > UserInfo connection.
  2. Double-click tXMLMap in the design workspace to open the Map Editor.
  3. Right-click on the root node of the input table and select Create Sub-Element. Name the sub-element as person in the popup dialog box.
  4. Right-click on the person node created in the previous step and select As loop element.
  5. Create two sub-elements to the person node by selecting Create Sub-Element in the contextual menu, id and name in this use case.
  6. Click the [+] button on the top right to add an output and name it as Response.
  7. Click the [+] button on the bottom right to add a column body of Document type for the output.
  8. Right-click the node root in the output table and select Create Sub-Element. Name the sub-element as person in the popup dialog box.
  9. Right-click the person node created in the previous step and select As loop element.
  10. Create three sub-elements to the person node by selecting Create Sub-Element in the contextual menu, id, name and company in this use case.
  11. Select the id column from the input table and drop it onto the Expression field of the id node of the output table.
  12. Select the name column from the input table and drop it onto the Expression field of the name node in the output table.
    Click the Expression field of the name node in the output table, and click [...] in this field to show the [Expression Builder] wizard.
    In the Expression area, enter StringHandling.UPCASE([UserInfo.body:/root/person/name]) to convert the name of the user to upper case. Click OK to close the wizard.
    For further information about using the Expression Builder, see Talend Studio User Guide.
  13. In the Expression field of the company node, enter "Talend".
  14. Click OK to save the settings.