Difference between revisions of "I2Rest Basic Test"

From i2Rest
Jump to: navigation, search
(SOAP UI)
(i2Rest Client)
Line 2: Line 2:
 
==ECHO==
 
==ECHO==
 
===i2Rest Client===
 
===i2Rest Client===
 +
The easiest way to test your i2Rest Server is to call test service ECHO using i2Rest Client. i2Rest supplied in i2Rest package, you don't need any REST testing tool installed.<br>
 +
Make sure i2Rest libl is in the library list, and just execute the next command:
 +
<pre>
 +
I2REST COMMAND(*POST)                                       
 +
      URL('<main gate URL>/run_program/echo/ec 
 +
          ho')                                             
 +
      BODY(*N '{"input":{"echo":"0"},"joblog":true,"tracein 
 +
            ":true, "traceout":true}''' 'application/json') 
 +
      OUTPUT(*JOBLOG)                                       
 +
      AUTHMETHOD(*NONE)                                     
 +
</pre>
 +
 +
And check the result in joblog:
 +
 +
<pre>
 +
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"                                 
 +
}                                                               
 +
</pre>
 +
 
===SOAP UI===
 
===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/.
 
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/.
  
 
===CURL===
 
===CURL===

Revision as of 14:14, 6 June 2020

ECHO

i2Rest Client

The easiest way to test your i2Rest Server is to call test service ECHO using i2Rest Client. i2Rest supplied in i2Rest package, you don't need any REST testing tool installed.
Make sure i2Rest libl is in the library list, and just execute the next command:

I2REST COMMAND(*POST)                                         
       URL('<main gate URL>/run_program/echo/ec  
           ho')                                               
       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"                                   
}                                                                 

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/.

CURL