Difference between revisions of "I2Rest Basic Test"
Pavel.lobko (talk | contribs) (→SOAP UI) |
Pavel.lobko (talk | contribs) (→SOAP UI) |
||
Line 43: | Line 43: | ||
<pre>http://api.<Main Gate URL>/run_program/echo/echo</pre> | <pre>http://api.<Main Gate URL>/run_program/echo/echo</pre> | ||
where <Main Gate URL> is the value, that was set up during [[I2Rest_Server_quickstart|initial server configuration]].<br> | where <Main Gate URL> is the value, that was set up during [[I2Rest_Server_quickstart|initial server configuration]].<br> | ||
− | [[File:Echo-soapui-2.png]]<br> | + | <div style="padding-bottom:6px">[[File:Echo-soapui-2.png]]<div><br> |
Choose "application/json" Media type and provide request body: | Choose "application/json" Media type and provide request body: | ||
<pre> | <pre> | ||
Line 55: | Line 55: | ||
Then submit request.<br> | Then submit request.<br> | ||
Find server responce under the JSON tab:<br> | Find server responce under the JSON tab:<br> | ||
− | [[File:Echo-soapui-4.png|800px]] | + | <div style="padding-bottom:6px">[[File:Echo-soapui-4.png|800px]]<div> |
===CURL=== | ===CURL=== | ||
We assume that you already have CURL installed. | We assume that you already have CURL installed. |
Revision as of 18:33, 7 June 2020
Contents
ECHO
ECHO is a service included in i2Rest package for testing purposes. It does nothing more than replies to request with the counter value.
i2Rest Client
The easiest way to test your i2Rest Server is to call service ECHO using i2Rest Client. i2Rest Client supplied in i2Rest package, you don't need any REST testing tool installed.
Make sure i2Rest library is in the library list, and just execute the next command (where <Main Gate URL> is the value, that was set up during initial server configuration) :
I2REST COMMAND(*POST) URL(http://api.'<Main Gate URL>/run_program/echo/echo') BODY(*N '{"input":{"echo":"0"}, "joblog":true, "tracein":true, "traceout":true}' 'application/json') OUTPUT(*JOBLOG) AUTHMETHOD(*NONE)
And check the result in joblog:
Server response (status 200, shown 280 bytes of 280): { "output": { "echo": "2" }, "joblog": [ "Input:", "echo (10):", "000000 :0 :F0 00 00 00 00 00 00 00 00 00", "Output:", "echo (10):", "000000 :2 :F2 00 00 00 00 00 00 00 00 00" ], "job": "123456/USRX/JOBNAME" }
As you can see i2rest Server responded with "OK" status 200, and the response contains ECHO output object.
SOAP UI
We assume that you already have Soap UI installed. If not, open source installation package could be found on https://www.soapui.org/downloads/soapui/.
Run SOAP UI, then go to File ---> New REST Project. Specify URI to request as follows:
http://api.<Main Gate URL>/run_program/echo/echo
where <Main Gate URL> is the value, that was set up during initial server configuration.