The narration of function and its parameter used to call an external/outgoing REST web service from ASYRRESTCLI library

By | July 1, 2020

The function “EXEC_REST_WS” is used to call an external/outgoing REST web service from ASYRESTCLI library and returns the status of the operation, the  parameters used in the function are described below,

Parameter 1:

Code               :NAME

Data Type       :Char

Description     : Name of the REST web service created.

Parameter 2:

Code               :HTTPMETHOD

Data Type       :Clbfile

Description     : HTTP methods can be used on any endpoint which map to application create, read, update, and delete (CRUD) operations:

HTTP method CRUD Action
GET Read Returns requested data
POST Create Creates a new record
PUT Update Updates an existing record
DELETE Delete Deletes an existing record

.

Parameter 3:

Code               :SUBURL

Data Type       :Char

Description     : It is a sub-URL that appends to the main URL ,Main URL which specified while creating REST web service in x3.

Parameter 4:

Code               :PARAM_COD

Data Type       :Char Array

Description     : Names that can be used as URL parameters.

Parameter 5:

Code               :PARAM_VAL

Data Type       : Char Array

Description     : Values corresponding to property names defined in PARAMS_COD.

Parameter 6:

Code               :HEADER_COD

Data Type       : Char Array

Description     : Names that can be sent in the request header as parameters..

Parameter 7:

Code               :HEADER_VAL

Data Type       : Char Array

Description     :Values corresponding to property name defined in HEADER_COD.

Parameter 8:

Code               :DATA

Data Type       :Clbfile

Description     : Data that is sent with POST and PUT methods.

Parameter 9:

Code               :Mode

Data Type       :Integer

Description     : If 1, the web service is called in ‘future’ mode; if 0, the ‘wait’ mode is used.

The difference between Wait and Future mode, wait mode is synchronous , the call has to wait until receives a response back from the external REST web service, while on the Future ( asynchronous) a unique identifier is created, and you can later on retrieve the result of your external call  with that UUID.

Parameter 10:

Code               : RETURNS

Data Type       :Char

Description     : If empty, the whole JSON feed is returned in RESBODY; if not empty, only the value of the corresponding property is returned in RESBODY.

Parameter 11:

Code               : RESHEAD

Data Type       :Clbfile

Description     : The response header returned by the web service.

Parameter 12:

Code               : RESBODY

Data Type       : Clbfile

Description     : The response body returned by the web service.

Conclusion:

This blog helps to understand what are the parameters with  its description and data type  used in EXEC_REST_WS function and also how to use synchronous and asynchronous mode.

Related Keywords: REST web services,EXEC_REST_WS,ASYRESTCLI,Parameters of EXEC_REST_WS function, Wait and Future Mode, Synchronous and Asynchronous mode.

Subscribe for more blogs!!!