Creating Web Services and operations

You create Web Services and operations that are used to get the RESTful API requested mainframe data and to transform the data into objects.

Before you begin

Before creating a Web Service, you need to know the name of the virtual table or virtual view that will be used to generate the SQL statement. You must also identify or verify the Data Virtualization Manager server service provider URLs to use to launch REST via z/OS Connect related actions (for details, see Setting REST z/OS Connect Web Services preferences).

Procedure

  1. On the Server tab, expand Services > Web Services.
  2. Expand the Web Services directory where you want the Web Service to reside and double-click Create Service.
  3. On the Web Services page, enter a unique name for the new Web Service and click Next.
  4. To add a new operation to the Web Service, on the Web Service Operation Type page, select Data Integration (REST via z/OS Connect or SOAP) and click Next.
  5. In the Browse SQL Metadata box, select the virtual table or virtual view to use when generating the SQL statement and click Next.
  6. On the SQL page, accept the default Name and Description fields or enter a new name or description.
  7. In the SQL Statement text box, accept or modify the SQL statement that displays and click Next.
    Note: RESTful URIs use GET operation for SELECT statements and POST operation for INSERT, UPDATE, and DELETE statements.
  8. In the SQL Inputs page, you can define the inputs to the SQL statements.
  9. On the SQL Results Set page, verify that the results are correct and make any necessary modifications.
  10. Click Finish.
    The Web Service operation details display in the Web Service Operation Editor. If necessary, modify the details in the editor.
  11. To validate your Web Service complete the following:
    • Right-click the operation in your new Web Service and select z/OS Connect REST Interface > Refresh to synchronize your new Web Service with the service provider.
    • Right-click the operation in your new Web Service and select z/OS Connect REST Interface > Execute Query to test the new Web Service in a web browser.
  12. Optional: To test the Web Service, right-click the new operation or the new Web Service and click Open in Tester. Choose one of the following test options:
    • Default: use the default test settings.
    • Create New: create a new test group that you can name and configure.
    • Select an existing test group.
  13. Optional: To create a .sar file, on the Server tab, right-click on the Web Service operation and click Create z/OS Connect SAR File(s). The file is saved to your workspace and is available from the zOSConnect folder on the Client tab.

    You can use this SAR file to create a service and deploy it using integration platforms such as IBM Explorer.

What to do next

To continue adding more operations under this Web Service group, click Create New Operation and repeat the steps starting at step 5.