Skip to main content Skip to complementary content

Configuring the service to add a movie

Configure the components for your POST request.

Procedure

  1. Double-click the tRESTRequest component, click the addMovie field and click the […] button to open the schema.
  2. Remove all the columns and create a new one named body with Document as its Type, then click OK.
  3. Double-click the tExtractXMLField and enter "/movie" in the Loop XPath query field.
  4. In the Mapping table, enter the XPath query for each element.
    The XPath query should be the name of the corresponding column between double quotes. For example, the query for movieId should be "movieId".
    Basic settings view of the component.
  5. Double-click the tXMLMap_3 to open the Map Editor.
  6. Right-click the root node and click Rename, then enter movies as the new name and click OK.
  7. Right-click the movies node and click Create Sub-Element, then name the element movie and click OK.
  8. Right-click the movie node and click As loop element, then click OK.
  9. Select all the columns in the top left corner, then drag and drop them on the movie node.
  10. In the dialog box that appears, select Create as sub-element of target node and click OK.
    Mapping in the Map Editor.
  11. Click OK to close the editor.
  12. Save your service.

Results

Your data service is now configured, you can run it and start testing it in Talend Cloud API Tester.

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – please let us know!