REST
Characteristics - REST
Representational state transfer (REST) is a software architectural style that describes a uniform interface between decoupled components in the Internet in a Client-Server architecture. To learn more about the standard visit the REST section in Wikipedia website.
Information Model Requirements
The first Node after the root node can be of type Event , Command or Variable
The following Node Types can be used under the Event Node:
Variables with a Simple Data Type represents the key-value pairs.
Variables with a Custom Data Type represent objects that can contain key-value pairs.
Configuration - REST Server
The following sample configuration shows how variables can be made accessible over a REST server.
Select the root model node in the tree on the left.
Enter a path prefix.
Configure the REST Server endpoint.
Enter the IP.
Enter the port.
Enter the Content-Type.
Check the webapp checkbox and provide the WAR-file if you want to host an application.
Select the Message encoding standard.
Check the box to Log data (E.g., the body of a request).
Click the Apply button and save the Channel by clicking the Save button on the upper right corner.
Description of configuration properties:
Property |
Description |
Example |
---|---|---|
pathPrefix |
Prefix for the URL |
|
Port |
Port of the REST server |
|
IP |
IP address of the REST server |
|
DefaultContentType |
Is used to indicate the media type of the resource |
|
webapp |
Possibility to host an application |
|
Message encoding |
Encoding standard for messages |
|
Configuration - REST Client
The following sample configuration shows a GET request using url parameters.
Select the root model node in the tree on the left
Select the content type - defines the media type of the associated representation
Set the wait timeout
Select the Command node
Enable the Command routes checkbox for the configuration of the following fields:
Enter the URL - If URL parameters are used then add each parameter in the following syntax
${id}
Select the HTTP method.
Headers (Optional) - Enable the checkbox Headers for the configuration of the following fields:
Enter the name of the header
Enter the value
Add multiple header entries by clicking the Add button
Delete a header by clicking the Delete button
Select the Authentication type
Select the Message encoding standard
Check the box to Log data (E.g., the body of a request).
URL Parameters (Optional) - Select a custom variable node
Enable the Command routes for the configuration of the following fields:
Select the Content Type
(Optional) Enter a Field Name in case the Information Model Node is not matching the REST API
Description of configuration properties:
Property |
Description |
Example |
---|---|---|
URL |
URL of the REST API. |
|
HttpMethod |
HTTP method for the action performed by the Client. |
|
HeaderName and Header Value |
To provide server and client with additional information |
|
Default Content Type |
Is used to indicate the media type of the resource. |
|
RouteHeaderConfiguration |
Headers represent the meta-data associated with the API request |
|
Authentication Type |
Type of the Authentication |
|
Content Type of Parameter Nodes |
Type of the Parameter |
|
Field Name |
For non-matching Information Model nodes and API spelling |
|
WaitTimeoutDuration |
Timeout in seconds until request is failing |
|
Message encoding |
Encoding standard for messages |
|