Table of Contents

Search

  1. Preface
  2. Web Services
  3. SOAP Web Services
  4. WSDL Data Object
  5. Schema Object
  6. How to Create a SOAP Web Service
  7. Operation Mappings
  8. Parsing Web Service SOAP Messages
  9. Generating Web Service SOAP Messages
  10. Web Service Consumer Transformation
  11. REST Web Services
  12. How to Create a REST Web Service
  13. REST Web Service Consumer Transformation
  14. REST Web Service Consumer Transformation Use Cases
  15. REST and SOAP Web Service Administration
  16. Appendix A: Datatype Compatibility

Web Services Guide

Web Services Guide

Defining the Resource Mapping

Defining the Resource Mapping

The Developer tool creates a resource mapping that contains the REST Output transformation that you created. Define a Read transformation and a Lookup transformation in the resource mapping.
  1. In the
    Resources
    tab, expand the
    Resource Mappings
    link in the Orders_Resource.
    The following image shows the Orders_Resource link in the Orders_Resource:
    The Orders_Resource appears as a box that contains a key, a definition, and a link to the resource mapping.
  2. Click the
    Orders_ResourceGetMapping
    link in the Orders_Resource.
    The mapping appears in the editor.
  3. Add the Customer data object to the mapping as a Read transformation.
  4. Click the REST Output transformation.
  5. On the REST Output transformation
    Properties
    tab, click the
    Ports
    view.
  6. Change the precision of the Customer_Key to 15 and the precision of the Customer_Name to 25.
    The Ports property shows two groups of ports. The Orders_Resource group has the Customer_Key and the Customer_Name ports. The Orders group has Order_key, Order_Price, Order_Date, and Customer_Fkey.
  7. Connect the Customer Key and the Customer Name ports from Read_Customer to the REST Output transformation.
    The following image shows the links between the Read_Customer transformation and the REST Output transformation:
    Read_Customer C_CUSTKEY is linked to Customer_Key in the Output transformation. Read_Customer C_NAME is linked to Customer_Name in the Output transformation.
  8. To add the Lookup transformation, right-click in the mapping and click
    Add Transformation
    .
  9. Select the Lookup transformation.
  10. Choose Relational Data Object Lookup and click
    Next
    .
  11. In the
    New Lookup Transformation
    dialog box, browse for and select the Orders physical data object. Choose to return all rows.
    The New Lookup dialog has the following fields: Relational Data Object name, repository location, and an option to determine behavior when a lookup finds more than one row.
  12. Click
    Finish
    .
    The Lookup transformation appears in the resource mapping.
  13. Click the Lookup transformation in the mapping to select it.
  14. In the Lookup transformation
    Properties
    view, select the
    Ports
    tab.
  15. Add a port called Customer_In. The port is a string with a precision of 15. You do not need to enable it for output.
    The Lookup transformation Ports view has one port called Customer_In. The port is a string with a precision 15.
  16. In the Lookup transformation
    Properties
    view, click the
    Lookup
    tab.
  17. Enter the following lookup condition:
    O_CUSTKEY = Customer_In
    The Lookup condition dialog box has one lookup condition. O_Custkey = Customer_In where O_Custkey is the lookup column and Customer_In is the input port.
  18. In the mapping canvas, link the C_CUSTKEY port from Read_Customer to the Customer_In port of the Lookup transformation.
  19. Link the following output ports from the Lookup transformation to ports in the REST Output transformation:
    Lookup Transformation
    Output Transformation
    O_ORDERKEY
    Order_Key
    O_TOTALPRICE
    Order_Price
    O_ORDERDATE
    Order_Date

0 COMMENTS

We’d like to hear from you!