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. Datatype Compatibility

Web Services Guide

Web Services Guide

How to Create a REST Web Service From a Data Object

How to Create a REST Web Service From a Data Object

You can create a REST web service from a data object in the Model repository. The Developer tool creates a default mapping that contains a Read transformation and an Output transformation. You can select the data object columns to include in the REST web service resource.
  1. Click
    File
    New
    >
    Data Service
    .
  2. On the
    Select a Wizard
    dialog box, choose
    REST Web Service
    . Click
    Next
    .
  3. On the
    REST Web Service
    dialog box, enter a name for the web service. Default name is REST_Web_Service. Click
    Next
    .
  4. On the REST Resource dialog box, click
    New
    Create from data object
    .
  5. Select a data object from the list of data objects in the Model repository and click
    OK
    .
    The REST Resource dialog box shows the REST resource from the data object you chose.
  6. Select which columns to include in the resource. Select the primary key for the resource.
    By default, all columns are selected. You can uncheck the columns that you do not want to include in the resource. By default the GET method is selected. Do not clear this option.
    The following image shows the REST resource dialog box:
    The New REST Web Service dialog box contains a selectoin arrow to choose how to create the resource. When you choose to create the resource from a data object, the fields in the data object appear in the dialog box.
  7. Click
    Finish
    to create the web service.
    The REST web service
    Resources
    view appears in the Developer tool.
    The following image shows the
    Resources
    view in the Developer tool:
  8. You can expand the components in the
    Resources
    view to view the key, the columns in the definition, and a link to the resource mapping.
    The following image shows the resource key, the definition columns, and the link to the resource mappings:
  9. Click the resource mapping link to view the resource mapping.
    The following image shows the default resource mapping:
  10. Add transformations to the mapping if necessary.
  11. To test the web service, navigate to the
    Data Viewer
    view.
  12. In the
    Input Settings
    , choose the resource mapping to test in the
    Data Access Value
    field.
  13. To filter the output by key, enter a key to search for in the
    Resource Identifier
    field.
  14. To filter the output by other elements, enter a filter condition. Click the value field to open the Expression editor.
    You can enter multiple expressions in the Expression editor.
    The following image shows the
    Input Settings
    in the
    Data Viewer
    view:
  15. Click
    Run
    to view the output.
    The output is JSON or XML based on the web service configuration.
  16. Deploy the web service to a Data Integration Service.

0 COMMENTS

We’d like to hear from you!