BridgeGate™


Tutorial 12: Using BridgeGateHTTP Adapter

Table of Contents

Getting Started with the BridgeGateHTTP Tutorial

In this exercise we will create an inbound (GetData) HTTP listener; registering a BridgeGateHTTP service. This is not be confused with the HTTP adapter type, which can also be used as a GetData, and was the predecessor to the BridgeGateHTTP adapter.

Specifically, we will create two BridgeGateHTTP services:

BridgeGateHTTP (1) - listens for anonymous inbound http calls and uses a streaming file (POST request type) data as the source data for further processing

BridgeGateHTTP (2) - listens for authenticated inbound http calls and uses a URL parameter (GET request type) value as the source data for further processing


Setting up BridgeGateHTTP Service (1)

Creating the Workflow

Right click in the Workflow Group Navigator on the Workflow Group you want to use for this sample. From the context menu, select "New Workflow Wizard", select "New workflow", click next. Name the workflow "BridgeGateHTTP(1)" and click finish. BridgeGate™ will force the name to lower case.

Figure - Creating a new Workflow

Create Get Data workflow item

The new workflow will be created and open. In the Workflow Item Navigator, right click and select "New Get Data".


Figure - Creating a new Get Data workflow item

Name the Get Data "ListenForInboundHTTP". Choose the Connection Type "BridgeGateHTTP". Below describes how to configure the workflow item.

BridgeGateHTTP(1) Configuration

Figure - BridgeGateHTTP Connection Type for the Get Data workflow item

Configuration

Value

Enable Workflow to be executed as a Service

Must check this box to enable the BridgeGateHTTP listener

URLPreview

Shows a sample/preview of how to call the BridgeGateHTTP. *Remember since it is HTTP it can be called from any client application which uses HTTP

Example dissected:

http://[SERVER_URL]/portal/executeworkflow?accountName=samples&wfGroupName=sample12&wfName=bridgegatehttp(1)&source_param=[SOURCE_DATA]

[SERVER_URL] - placeholder for the actual bridgegate web server where this service is listening at.

[SOURCE_DATA] - this value is to be used as the source data in any further processing of this workflow.

Authenticate

When this is checked requires the calling http request URL to contain additional parameters to authenticate by. Refer to BridgeGateHTTP(2) for configuration example

Receive POST Data

When this is checked expects that the source data will NOT be in the URL (as a parameter) but instead as a streamed in file. When this option is checked any mapped parameters cannot be used as the source data

Add to Workflow Session

When selected this will add the parameters values in the workflow session, and make them accessible in the workflow session […] ellipses for subsequent workflow items

Use as Source Data

When selected this will use exactly one parameter's value as the source data for further processing in the workflow

Send Synchronous Response

Enables the get data to send a response back to the calling workflow (e.g., to confirm receipt)

Create Send Data workflow item

In the Workflow Item Navigator, right click and select "New Send Data".

Figure - Creating a new Send Data workflow item


Name the Send Data "SyncResponseBack". Choose the Connection Type "Synchronous Response". Below describes how to configure the workflow item.

Figure - Send Data workflow item

Send Data widget

Value

Data Source Type

FORWARD ONLY DATA

Source Workflow Item

The desired GetData source data (ListenForInboundHTTP )

Connection Type

Synchronous Response

Get Data

The GetData item which with the synchronous response checked


Testing the BridgeGateHTTP (1)

Ensure that the workflow you just created is enabled as a service and saved, and transferred to the BridgeGate server prior to continuing.

>

You may use any application which supports HTTP to test this workflow, two example clients are:

Web browser

BridgeGate Workbench

For this demonstration we will use a plain web browser to perform our test. Note the BridgeGateHTTP(2) testing section provides an interaction example using the BridgeGate Workbench.

Testing GET with Web Browser

When testing, be sure to copy & paste the "Preview URL", which is displayed in the BridgeGateHTTP GetData, and change the placeholder parameters to reference your actual environment. The figure below shows an example of this:

Figure - Entering URL in Browser

After entering the URL and refreshing the browser, a success message (synchronous response) should be displayed.

If you did not receive a successful response back from the server refer to Troubleshooting Tips in this document.

Setting up BridgeGateHTTP Service (2)

Creating the Workflow

Right click in the Workflow Group Navigator on the Workflow Group you want to use for this sample. From the context menu, select "New Workflow Wizard", select "New workflow", click next. Name the workflow "BridgeGateHTTP(2)" and click finish. BridgeGate™ will force the name to lower case.

Figure - Creating a new Workflow

Create Get Data workflow item

The new workflow will be created and open. In the Workflow Item Navigator, right click and select "New Get Data".

Name the Get Data "ListenForInboundPOSTHTTP". Choose the Connection Type "BridgeGateHTTP". Below describes how to configure the workflow item.

BridgeGateHTTP(2) Configuration

Figure - BridgeGateHTTP Connection Type for the Get Data workflow item

Configuration

Value

Enable Workflow to be executed as a Service

Must check this box to enable the BridgeGateHTTP listener

URLPreview

Shows a sample/preview of how to call the BridgeGateHTTP. *Remember since it is HTTP it can called from any client applications which use HTTP

Example dissected:

http://[SERVER_URL]/portal/executeworkflow?accountName=samples&wfGroupName=sample12&wfName=bridgegatehttp(2)&userName=[USER]&password=[PWD]

[SERVER_URL] - placeholder for the actual bridgegate web server where this service is listening at

[SOURCE_DATA] - this value is to be used as the source data in any further processing of this workflow

[USER] - placeholder for a valid username

[PWD] - placeholder for a valid password

Authenticate

When this is checked requires the calling http request URL to contain additional parameters to authenticate by, and are noted by the URL Preview above (userName and password parameters)

Receive POST Data

When this is checked expects that the source data will NOT be in the URL (as a parameter) but instead as a streamed in file. When this option is checked any mapped parameters cannot be used as the source data

Add to Workflow Session

When selected this will add the parameters values in the workflow session, and make them accessible in the workflow session […] ellipses for subsequent workflow items

Use as Source Data

When selected this will use exactly one parameter's value as the source data for further processing in the workflow

Send Synchronous Response

Enables the get data to send a response back to the calling workflow (e.g., to confirm receipt)

Create Send Data workflow item

In the Workflow Item Navigator, right click and select "New Send Data".

Figure - Creating a new Send Data workflow item

Name the Send Data "SyncResponseBack". Choose the Connection Type "Synchronous Response". Below describes how to configure the workflow item.

Figure - Send Data workflow item

Send Data widget

Value

Data Source Type

FORWARD ONLY DATA

Source Workflow Item

The desired GetData source data (ListenForInboundPOSTHTTP )

Connection Type

Synchronous Response

Get Data

The GetData item which with the synchronous response checked


Testing the BridgeGateHTTP (2)

Ensure that the workflow you just created is enabled as a service and saved, and transferred to the BridgeGate server prior to continuing.

This tutorial uses authentication. In order to successfully interact with the service, an authorized user's credentials must be passed with the http request. Be advised, a valid consists of a user profile setup in the BridgeGate Portal and has BridgeGateHTTP protocol rights (checked).

You may use any application which supports HTTP to test this workflow, two example clients are:

Web browser

BridgeGate Workbench

However, in order to use a web browser for this particular BridgeGateHTTP service, the calling HTTP browser must trigger a POST request type. The easiest way to do this is to create a web a method="post" set on the form.

Conversely, for this demonstration we will use the BridgeGate Workbench.

Testing POST with BridgeGate Workbench

Start by creating a new HTTP workflow, not to be confused with the BridgeGateHTTP, in the workbench by following similar steps as shown above to create the workflow and GetData workflow item.

For the GetData, we'll need to pick up some data from a local directory. Use the FILE adapter type to pick up some sample data from a local path. Figure below shows an example configuration.

Figure - GetData Sample Configuration

Next, create a SendData which will submit (POST) a file to the BridgeGateHTTP service. Be sure to copy & paste the Preview URL similarly to how was done in the BridgeGateHTTP(1) tutorial, and replace with the necessary parameters, including the authentication parameters.

Figure below shows an example configuration.

Figure - SendData sample configuration

Save and test the workflow. If successful, the send data results should return the data from within the file delivered (picked up by the GetData), similar to shown below.

If you did not receive a successful response back from the server refer to Troubleshooting Tips in this document.

Troubleshooting Tips

An unresponsive or unsuccessful response back may indicate you have a problem with your configuration, check:

The BridgeGate HTTP Server is up

The BridgeGateHTTP service is enabled

*You may check in the portal by:

Log into the portal with a valid user's credentials

Choose the desired account to access

Select the Operations -> Processing -> Services tab for services listing

Expand the BridgeGateHTTP service link to show all available services, similar to the following figure.

Figure - portal services listing

Verify the desired BridgeGateHTTP is available and enabled.

If nothing is shown in the portal then the server has not detected the workflow change, re-transfer the workflow and verify again.