REST Reference

Create a REST Reference binding to consume a REST endpoint. You cannot edit the REST Reference binding configuration.

Prerequisites

Swagger 2.0-compliant REST API documents must be imported into the TIBCO Business Studio™ for BusinessWorks™ project's Service Descriptors folder. This will give you the ability to expand and collapse endpoints, operations, parameters and response codes in the Project Explorer view.

To consume a REST API that exists in the Service Descriptor of the project, do the following:

Procedure

  1. Expand the Swagger 2.0 files in the Service Descriptors special folder to view the endpoints, operations, parameters, response codes.
  2. Drag and drop an endpoint on the right side of the canvas to create a REST Reference Binding.
    This will create a cloud shaped icon with a right facing arrow. The cloud is an indication that it is a REST Reference whereas the arrow within the cloud indicates that it is a binding. Since the binding is within a cloud, it is an indication that it is a REST binding. You cannot convert a REST binding to a SOAP binding or vice versa.
    Note: When you create a REST reference for the service, make sure to edit the Default Host field in the HTTP Client Resource to reflect the actual host name. By default, the Default Host field is set to localhost.
  3. Drag and drop an operation from the Reference Binding on to the canvas.
    This creates an Invoke activity which is pre-configured to invoke the operation. It also creates an HTTP Client Shared Resource with the host name and port number. The configuration for these entities is copied from the Swagger document from which you created the Reference Binding. The Reference consists of the name of the API as well as the operations it supports.

    When invoking a POST or PUT method, you must provide the request string in the Input tab. To do so, click the column next to item under postRequest in XPath Expression and provide the request string in the drop-down box.

  4. Test the configured process using the TIBCO Business Studio for BusinessWorks Debugger.