Consuming a REST Endpoint in TIBCO Business Studio for BusinessWorks

Create a REST Reference binding to consume a REST endpoint.

Note: You cannot edit the REST reference binding configuration for APIs that are imported from a source external to TIBCO Business Studio for BusinessWorks.

Prerequisites

Swagger API documents must be imported into the 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.

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

Procedure

  1. Expand the Swagger file in the Service Descriptors special folder to view the endpoints, operations, parameters, and 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 REST 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 dropdown box.

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