Skip to main content Skip to complementary content

Creating the service

Create a data service to implement and test your API.

About this task

In this procedure, you will create a data service that uses the three operations in your API definition to read and write movie data in a database.

Procedure

  1. In your Repository, right-click Job Designs and select Create Standard Job.
    Repository tree view.
  2. Enter a Name, Purpose and Description for your data service, then click Finish.
  3. Expand the Metadata > REST API Definitions nodes of the repository, and drag your API definition to your workspace.
    A tRESTRequest component is added.
  4. Add a tFlowToIterate component to the right of the tRESTRequest.
    You can add a component by searching in the Palette or by entering its name directly in the workspace.
    Design workspace.
  5. Right-click the tRESTRequest icon and click Row > getMovies, then click the tFlowToIterate icon to link the components.
  6. From Metadata > Db Connections > connection_mysql > Table schemas, drag your movies schema and drop it to the right of the tFlowToIterate.
    Repository tree view.
  7. In the dialog box that appears, select tDBInput(MySQL).
  8. In the next dialog box, click Yes to add the context variables to your service.
  9. Connect the tFlowIterate to the tDBInput with a Row > Iterate connection.
  10. Add a tXMLMap and a tRESTResponse.
  11. Connect the tDBInput to the tXMLMap with a Row > Main connection.
  12. Connect the tXMLMap to the tRESTResponse with a Row > Main connection, and name the output movies, for example.
  13. In the dialog box that appears, click Yes to get the schema of the target component.
  14. Click the Save icon or press Ctrl + S to save your service.

Results

You have added and connected all the components needed for your first GET operation. Your data service should look like this:
Job in the design workspace.

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!