Skip to main content Skip to complementary content

Creating a Job to consume the REST Service with JWT validation using Keycloak

Procedure

  1. From the Palette, drag and drop a tFixedFlowInput, tRESTClient, tReplicate, two tXMLMap, and tLogRow components onto the design workspace.
  2. Label the components for better identification of their roles and link the them as shown above.
  3. In the Basic settings view of the tFixedFlowInput component:
    1. Click the [...] button next to Edit schema to open the Schema dialog box, and edit the input schema as follows:
    2. Select Use Inline Table and configure the inline table as follows:
  4. In the Basic settings view of the tRESTClient component:
    1. Fill the URL field with "http://localhost:8090".
    2. In the Relative path field, enter "/services/customers/"+input.number.
    3. Select the Use Authentication check box and the OAuth2 Bearer authentication type. In the Bearer Token field, copy the access token you got from http://localhost:8080/realms/MyDemoRealm/protocol/openid-connect/token.
  5. In the map editor of the tXMLMap component labeled Map_all:
    1. Rename the Root node under body of the input table as customers.
    2. Create a sub-element to customers and name the sub-element customer. Set the customer node as loop element.
    3. Create sub-elements id, city, firstName, lastName to customer.
    4. Click the [+] button on the bottom right to add five columns for the output: statusCode of Integer type and id, city, firstName, lastName of String type.
    5. Click Auto map to map the columns with the same name automatically.
  6. Repeat the previous step to map the input and the output tables of the tXMLMap component labeled Map_singleton as shown below.
  7. In the Basic settings view of the tLogRow component labeled Log_All, select Table in the Mode area.
  8. In the Basic settings view of the tLogRow component labeled Log_Singleton, select Vertical and Print label modes.
  9. Run the Job.
    You will get the following response from the REST Service.

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!