Server Reference Guide : 11. JSON-RPC 2.0 Interface
 
Share this page                  
JSON-RPC 2.0 Interface
 
Overview
Intended Audience
Sending JSON-RPC Requests to the Server Application
JSON-RPC Request Named Parameters
Returning Values to the Caller
JSON-RPC Notifications
JSON-RPC Errors
JSON-RPC Batch Requests
JSON-RPC Configuration File
JsonConfig4App Utility
Creating a Sample OpenROAD Server Application with JSON-RPC Support
Overview
The JavaScript Object Notation Remote Procedure Call (JSON-RPC) is an interface OpenROAD can use for data interchange in programming.
The JSON-RPC 2.0 interface to the OpenROAD Server provides external access to 4GL business logic through requests in JSON format from the external interfaces to the OpenROAD Server (COM, DCOM, Java, .NET) and from any languages and tools providing HTTP or HTTPS support, for example JavaScript, PHP, Java, C#, Python, curl, and so on.
JSON-RPC is a JSON-based Remote Procedure Call protocol standard that follows the JSON-RPC 2.0 specification (http://www.jsonrpc.org/specification).
The JSON-RPC 2.0 interface lifts limitations of existing 4GL procedure calls (through Call4GL() or Callproc() methods) to the OpenROAD Server.
Using the JSON-RPC 2.0 interface offers the following features:
4GL procedures called can have a return value.
This value will be represented in the “result” of the response message. Therefore there is no need to wrap such procedures by an SCP with ByRef parameters.
Multiple or circular references are preserved in objects passed as parameters and returned. They will be represented using “$id” and “$ref” meta properties.
Subclass objects or arrays can be passed to parameters of a defined class or array type. This avoids SCP proliferation.
Objects and arrays of system classes can be passed.
Serializable attributes for classes are configurable.
Values may be returned to the caller in different ways (by return value or BYREF parameters).
Batch requests are possible to be passed to the server with one call, providing a JSON array containing request objects. The response will contain an array of response objects.
Language independence is achieved (like the existing XML interface, but without its limitations)