Restful web services poller
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 name | Supported Values | Description | required |
---|---|---|---|
Name | Any string | A unique plugin name | yes |
User | Any string | Username (generally API token) | no |
Password | Any string | Password | no |
Configure a profile with REST Poller Plugin
The following options are available:
Field name | Supported Values | Description | required |
---|---|---|---|
Profile name | Any string | A unique plugin name | yes |
URL | Any string | Endpoint URL to get data from | yes |
Message type | Any string | Defines the 1Gateway internal message type the requests results gets assigned to | no |
Interval | Number | Interval how often requests gets polled in seconds | yes |
Accept | Any string | application/json | yes |
Header (1-5) name | Any string | Header name to poll with | no |
Header (1-5) value | Any string | Header value to poll with | no |
Configure a profile with the Advanced REST Poller Plugin
The following options are available:
Field name | Supported Values | Description | required |
---|---|---|---|
Profile name | Any string | A unique plugin name | yes |
URL | Any string | Endpoint URL to get data from, can include field / variable names indicated by $<variablename>$ | yes |
Field (1-3) name | Any string | Define field / variable name. The field / variable is unique within the same plugin configuration. It can be used in different plugins. | no |
Field (1-3) location | Any string | Define matching location of the field / variable in the result. | no |
Field (1-3) initial value | Any 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 |
URL2 | Any string | Second 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 type | Any string | Defines the 1Gateway internal message type the requests results gets assigned to | no |
Interval | Number | Interval how often requests gets polled in seconds | yes |
Accept | Any string | application/json | yes |
Header (1-5) name | Any string | Header name to poll with | no |
Header (1-5) value | Any string | Header value to poll with | no |
See also