Tutorial & Interface
eiConsole Tutorial Basic
HTTP Request Response Pair
This Interface demonstrates how to accomplish a request-response pair. This is a relatively standard mechanism of interacting with webservices and is easily achieved in the eiConsole and eiPlatform. This interface demonstrates how the eiConsole and eiPlatform can be used to interact with an HTTP Webservice which provides a synchronous response.
HTTP Request Response Pairs may be used when:
- A webservices callout needs to be made to acquire additional data
- A webservice is the final target of a route and the response needs to be recorded
How to Run This Example
In order to run this example, the provided environment properties file must be configured to point to a local directory, where the sample (Sample2.xml) is to be dropped. This example must be run in the EIP Emulator mode, which is accessible when a given route is loaded in the eiConsole, under the “Tools” menu, under “Local eiPlatform Emulator“.
How to Use This Example
Download the INTERFACE file and save it to your local disk.
Open the eiConsole, click on the File drop-down menu and select Import Working Directory/Route/Format. Highlight the name of the file to import and press the Import Selected button. The imported Interface will appear in your current Working Directory.
Next, follow the tutorial and walk through it step-by-step. You may check your work against the provided Route (Sample Data).
This interface has three functioning Routes; the request route, the response route, and a sample webservice route. It performs no data transformation.
The listener polls a directory set by a configuration value stored in the environment properties file (included with this interface) every five seconds.
The transport has two import configuration values; the first is the Target URL. This determines the webservice to be hit. Here, we’re anticipating to target our webservice route running in emulator mode.
NOTE: the port number must be the same in the Target URL and in the emulator configuration.
The second important configuration is the Response Listener; if left blank, the HTTP request will be performed asynchronously. If a response listener or a Programmable Listener running in the same eiPlatform/eiConsole instance is provided, the request will be performed synchronously, that is, expecting data to be returned. The HTTP response will be used to invoke the response listener.
The response route provides the Programmable Listener our request route was expecting; nothing substantive happens in this route, and the data received is written directly to disk.
Note that the file name and file extension are coming from our request route; transaction attributes persist across programmable listeners, meaning that here, we are using the file name and extension from the original file our request route picked up.
The webservice is very simple; it provides an HTTP request path and provides a synchronous response. The Synchronous Response transport is contextual; it will figure out what you’re trying to respond to based on the transaction coming in.
There are a number of different listeners that support synchronous response, including the HTTP Post Transport; this transport is made synchronous if and only if the “Synchronous” configuration option is ticked under the Advanced tab.
This concludes this demonstration of an HTTP request-response pair.