Using the Wizard to Create a REST Reference

In TIBCO Business Studio™ for BusinessWorks™, you can invoke a REST service without a Swagger file. As long as you have the URL for the endpoint in a running service, you can use the REST Reference Wizard in TIBCO Business Studio for BusinessWorks to create a REST reference to invoke the service. A reference created using a wizard can be modified since it does not have a Swagger contract to adhere to.

In the wizard, you can choose the operation(s) to implement in the reference and set up the data elements used for the request and the response of each operation. You can add additional operations to the reference after the reference has been created too.

Prerequisites

  • You must have the endpoint URL.
  • You must know which operations are supported by the service.
Note: When invoking external REST services using the REST Reference Wizard, the Request and Response of the REST method must be configured with the corresponding XSD schema element used by the invoked service, otherwise the service is not invoked.

To create a REST reference, follow the steps:

Obtain the URL for the service endpoint

Typically, the URL for an endpoint can be obtained from the API web page or some other documentation where the service is described. This documentation should list the details of the service such as operations that the service supports, the parameters used and the data definitions for the requests and responses.

Verify the service is running

You can verify that the service is running by invoking it using a testing tool such as Postman or SoapUI.

Create a new application and open the REST Reference Wizard

  1. Create a new application if you do not already have one. For more information, see the section "Creating an Application" in the TIBCO ActiveMatrix BusinessWorks™ Application Development guide.
  2. Click the Create REST Reference icon to open the REST Reference wizard.

  3. Enter the URL for the service in the Service URL text box.
  4. Select the operations that you want to implement in your reference by selecting respective check boxes and click Next.
  5. Configure the request and response type for your operations in the Configuring the Operation screen by selecting the request and response type from their respective drop-down menus. Click Finish. The wizard creates a REST reference. You should see it on the extreme right of your Process Editor.
  6. Open the Reference properties view by clicking on the reference name.

  7. Click the HTTP Client link to open the HTTP Client Shared Resource configuration page and verify that the Default Host has been set to the host where the service resides.
  8. Make sure that the port number is correct.
    Note: Do not use port 7777. It is reserved for internal use.
  9. You can optionally do the following in the Reference properties view:
    • Add parameters for your operations
    • Configure operation details, such as Request and Response for an operation by clicking on the operation in the Operations table, then configuring the Response and/or Request details in their respective tabs.

      For more information about how to add parameters, see Parameter Support section.

    • Optionally, you can add an operation using the Create REST Operation wizard. To open this wizard, hover your mouse next to the REST reference name until you see the Create REST Operation icon and click the icon to open the wizard:

      On the Create new REST Operations page, select the operation you want to create and click Next. Configure the Request and Response for the operation if need be and click Finish. You have the option to configure your request and response for the operation at a later time too from the Reference properties view.

You can now invoke any operation by dragging and dropping it in the process editor.