Description

The Rest Poller WS Listener is a generic web service client that collects data in different formats (XML, JSON) from an external source. 

Prerequisites

Install the 1Gateway SDK by dragging the jar file into the installation page.

Installation

Make sure you have the 1gateway zip file that includes the plugin files and valid licences information ready. This file has been provided to you with the installation files.

1 - Login

Login to 1gateway, and make sure you are in "Advanced mode". If this is the first time you log in, the default user and password are both 'admin' (without the quotes).

2 - System Maintenance

Click on the menu icon and choose the option "System maintenance"


3 - Upload file


In the System maintenance view you can either drag and drop the downloaded zip file or select it by clicking the "choose file" button.

4 - Restart

After the upload installation will be confirmed. Restart 1Gateway to ensure any locked files are updated.

Configuration


Open the main menu and click on "New plugin"

Select the plugin you want to configure. Use the Filter field if needed.

The REST poller polls data from a configured web service endpoint. Currently, only the JSON format is accepted.  Once you've installed the REST Poller Plugin there is a "REST poller" plugin and the "Advanced REST poller" plugin available. The "Advanced REST poller" allows to execute two polls within one profile. Results of the first poll can be used in the URL of the second poll. 

The REST poller configuration is divided in two sections:

  • plugin
  • profile

The plugin sections applies to both variants and the following options are available:

Field nameSupported ValuesDescriptionrequired
NameAny stringA unique plugin nameyes
UserAny stringUsername (generally API token)no
PasswordAny stringPasswordno

Configure a profile with REST Poller Plugin

The following options are available:

Field nameSupported ValuesDescriptionrequired
Profile nameAny stringA unique plugin nameyes
URLAny stringEndpoint URL to get data fromyes
Message typeAny stringDefines the 1Gateway internal message type the requests results gets assigned tono
IntervalNumberInterval how often requests gets polled in secondsyes
AcceptAny stringapplication/jsonyes
Header (1-5) nameAny stringHeader name to poll withno
Header (1-5) valueAny stringHeader value to poll withno

Configure a profile with the Advanced REST Poller Plugin

The following options are available:

Field nameSupported ValuesDescriptionrequired
Profile nameAny stringA unique plugin nameyes
URLAny stringEndpoint URL to get data from, can include field / variable names indicated by $<variablename>$yes
Field (1-3) nameAny stringDefine field / variable name. The field / variable is unique within the same plugin configuration. It can be used in different plugins.no
Field (1-3) locationAny stringDefine matching location of the field / variable in the result.no
Field (1-3) initial valueAny string

Define initial value for the field / variable. It will be overwritten once the first poll has been.

After each poll the value of the last result entry is stored in 1Gateway internal mySQL database. So make sure to order poll results accordingly.

no
URL2Any stringSecond endpoint URL to get data from. It can include variables ($<variablename>$) defined as field in this profile. If the result of the first poll contains an array than URL2 will be invoked for each value of this variable.
Message typeAny stringDefines the 1Gateway internal message type the requests results gets assigned tono
IntervalNumberInterval how often requests gets polled in secondsyes
AcceptAny stringapplication/jsonyes
Header (1-5) nameAny stringHeader name to poll withno
Header (1-5) valueAny stringHeader value to poll withno

See also