Server Reference Guide : JSON-RPC 2.0 Interface : JSON-RPC Configuration File
 
Share this page          
JSON-RPC Configuration File
The 4GL procedures of an application, which should be available for JSON-RPC requests, must be configured through a file named applicationname.json (the same name as the application with a “.json” extension).
The file is searched in the following locations while executing the JSONRPC requests:
1. The directory specified by II_W4GL_JSON_CONFIG environment variable
2. The subdirectory orjsonconfig of the directory specified by II_CONFIG directory
3. The ingres/files/orjsonconfig subdirectory of the directory specified by the II_SYSTEM directory
The file is read during the initialization of the JsonHandler used internally during JSON-RPC requests (referenced by the CurJsonHandler global variable).
Registrations for the callable 4GL procedures are contained in a member named “registeredprocs” (a JSON object), containing a “rows” member (a JSON array), which contains a JSON object for each registered procedure with the following members:
“name”
Contains the 4GL procedure name
“params”
Is a JSON object containing a “rows” member (a JSON array), which contains a JSON object for each parameter used in a JSON-RPC request, having the following members:
“name”
Contains the parameter name
“byref_use”
Defines whether this parameter can be passed BYREF using the pseudo-parameter “$byref_params” in JSON-RPC requests (this is optional, default: false)
Notes:
Not all defined parameters of a 4GL procedure are required to be used in JSON-RPC requests.
The “params” member is optional; it can be omitted if a procedure has no parameters.
Additionally, the configuration file also allows setting JsonHandler attributes AlwaysAddClassname, IgnoreUnknownAttributes, and MaxNestingLevel (used during parsing or writing of JSON-RPC request/response messages) by using according (optional) members “alwaysaddclassname”, “ignoreunknownattributes”, and “maxnestinglevel” (lowercase names).
See the JsonHandler Class in the Language Reference Guide for more information about these attributes.