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 and SOAP Web Service Administration
  15. Datatype Compatibility

Web Services Guide

Web Services Guide

Creating the REST Web Service Resource

Creating the REST Web Service Resource

When you create the web service resource, you define the structure of the response message.
  1. In the Developer tool, click
    File
    New
    Data Service
    .
  2. Select
    REST Web Service
    and click
    Next
    .
  3. Enter Orders_Web_Service as the web service name. Click
    Next
    .
  4. In the
    REST Resource
    dialog box, click
    Create From Empty
    .
    A default resource appears.
    The New REST Web Service dialog box has a panel to list each resource you create. The dialog box show a default resource name called Resource. Beneath the Name is the description. The bottom panel is called Definition. You can enter elements to define the resource. Enter a name, type, key, minimum occurs, maximum occurs, and a description for each field. The default HTTP method is GET. The method is enabled by default.
  5. In the
    Name
    field, change the name of the resource from Resource to Orders_Resource.
  6. On the
    Definition
    panel, click
    New
    Element
    .
  7. Enter the following elements:
    Name
    Type
    Key
    Min Occurs
    Max Occurs
    Customer_Key
    string
    Yes
    1
    1
    Customer_Name
    string
    1
    1
    Orders
    string
    1
    unbounded
  8. Select the Orders element and click
    New
    Child
    .
  9. Enter the following child elements beneath Orders:
    Name
    Type
    Key
    Min Occurs
    Max Occurs
    Order_Key
    integer
    1
    1
    Order_Price
    decimal
    1
    1
    Order_Date
    integer
    1
    1
  10. Verify that the Get HTTP method is enabled.
  11. Click
    Finish
    .
    The following image shows the elements in Orders_Resource:
    The screenshot shows the New Rest Web Service dialog box with the customer and order elements. Customer_Key and Customer_Name are the first elements. Beneath Customer_Name is an Orders element. Orders is multiple-occurring and is unbounded. Within the Orders element is the Order_Key, Order_Price, and Order_Date.