SlideShare a Scribd company logo
1 of 11
Download to read offline
© Peter R. Egli 2015
1/11
Rev. 1.60
JSON-RPC indigoo.com
Peter R. Egli
INDIGOO.COM
JSON-RPC
JSON REMOTE PROCEDURE CALL
OVERVIEW OF JSON-RPC, A VERY SIMPLE AND
LIGHTWEIGHT RPC PROTOCOL
FOR DISTRIBUTED APPLICATIONS
© Peter R. Egli 2015
2/11
Rev. 1.60
JSON-RPC indigoo.com
Contents
1. What is JSON-RPC?
2. JSON-RPC interactions
3. Transport options for JSON-RPC
4. JSON serialization format
5. JSON-RPC 2.0 examples
6. When to use JSON-RPC
© Peter R. Egli 2015
3/11
Rev. 1.60
JSON-RPC indigoo.com
1. What is JSON-RPC?
JSON-RPC is a simple RPC mechanism, similar to XML-RPC.
Protocol:
Unlike XML-RPC which is a client-server protocol, JSON-RPC is a peer-to-peer protocol.
It uses JSON (Javascript Object Notation, RFC4627) as the serialization format and plain TCP
streams or HTTP as transport mechanism.
JSON message types:
JSON-RPC defines 3 message types:
Request:
Method invokation with arguments encoded in JSON.
Response:
Reply to method invokation containing the return argument encoded in JSON.
Notification:
Asynchronous request without response.
Specification:
JSON-RPC is very simple, i.e. the JSON-RPC specification is very short (ca. 5 pages).
See http://json-rpc.org/.
© Peter R. Egli 2015
4/11
Rev. 1.60
JSON-RPC indigoo.com
2. JSON-RPC interactions
JSON-RPC defines 2 message exchange patterns that support most of the usual peer2peer
interaction schemes.
A. Request-Response:
The sending JSON peer invokes a method on the remote JSON peer with a JSON request.
The remote peer sends back a JSON response message.
B. Notification:
The sending peer sends a single notification message. There is no response message.
JSON peer
Request (REQ)
Response (RSP)
method
params
id
Method to be invoked.
Request message:
Arguments to be passed to method as an array of objects.
Request ID to match request and response.
result
error
id
Object returned by the called method.
Response message:
Error object if an error occurred.
Request ID to match request and response.
Notification (NOT)
method
params
id
Method to be invoked.
Notification message:
Arguments to be passed to method as an array of objects.
Must be null (nothing to match).
JSON peer
JSON peer JSON peer
© Peter R. Egli 2015
5/11
Rev. 1.60
JSON-RPC indigoo.com
3. Transport options for JSON-RPC (1/2)
JSON does not require a specific transport protocol.
The JSON-RPC standard defines 2 transport protocols for conveying JSON messages.
A. TCP stream (default transport):
The JSON-RPC default transport is a simple TCP stream (JSON-RPC exchanges serialized
objects over plain TCP sockets).
JSON
-RPC
peer
JSON
-RPC
peer
REQ1NOT1
RSP1 REQ2 NOT2
RSP2
TCP stream connection
(2 unidirectional connections)
© Peter R. Egli 2015
6/11
Rev. 1.60
JSON-RPC indigoo.com
3. Transport options for JSON-RPC (2/2)
B. HTTP connection:
Here an HTTP connection is used as a transport channel.
The HTTP-request is used as transport container for JSON-request (REQ), JSON-responses
(RSP) and JSON-notification (NOT) messages that are sent from the JSON-peer with the HTTP
client. Likewise the HTTP-response is used for transporting JSON-messages from the JSON-
peer with the HTTP server.
N.B.: There is no mapping of JSON request to HTTP-request. HTTP is merely the transport
mechanism.
The HTTP client and server will need to use a long polling scheme so the server always has a
response ready to use for a RSP, REQ or NOT message.
HTTP
client
JSON
-RPC
peer
HTTP
server
REQ1NOT1
JSON
-RPC
peer
NOT1REQ1
HTTP GET request
REQ1NOT1
RSP1 REQ2 NOT2RSP1 REQ2NOT2
HTTP response
RSP1 REQ2 NOT2
RSP2 RSP2
HTTP POST request
RSP2
© Peter R. Egli 2015
7/11
Rev. 1.60
JSON-RPC indigoo.com
4. JSON serialization format (1/2)
JSON (Javascript Object Notation, RFC4627) is a lightweight, text-based, language-independent
data exchange format. JSON text is a sequence of tokens.
JSON types:
1. Primitive types:
string Sequence of 0..n Unicode characters, enclosed in quotation marks.
Example: „hello world“
number Numerical value (represention as used in most programming languages).
Examples: 3.45, 5E3
boolean true / false value
null Null value (= no object or no value)
2. Structured types:
Array Ordered sequence of 0..n values.
Example: [1,3,4]
Object Unordered collection of 0..n name:value pairs.
Name = string
Value = string, number, boolean, null, object, array.
Example: {"jsonrpc": "2.0", "method": "update", "params": [1,2,3,4,5]}
Encoding:
JSON text is encoded in Unicode. The default encoding is UTF-8.
© Peter R. Egli 2015
8/11
Rev. 1.60
JSON-RPC indigoo.com
4. JSON serialization format (2/2)
JSON grammar expressed in ABNF (excerpt only, ABNF syntax see RFC5234):
JSON-text = object / array;
begin-array = ws %x5B ws ; [ left square bracket
begin-object = ws %x7B ws ; { left curly bracket
end-array = ws %x5D ws ; ] right square bracket
end-object = ws %x7D ws ; } right curly bracket
name-separator = ws %x3A ws ; : colon
value-separator = ws %x2C ws ; , comma
whitespace = *{%x20 / %x09 / %x0A / %X0d)
value = false / null / true / object / array / number / string
false = %x66.61.6c.73.65 ; false
null = %x6e.75.6c.6c ; null
true = %x74.72.75.65 ; true
object = begin-object [ member *( value-separator member ) ] end-object
member = string name-separator value
array = begin-array [ value *( value-separator value ) ] end-array
number = [ minus ] int [ frac ] [ exp ]
string = quotation-mark *char quotation-mark
© Peter R. Egli 2015
9/11
Rev. 1.60
JSON-RPC indigoo.com
5. JSON-RPC 2.0 examples (1/2)
Notation:
--> Data sent to JSON service
<-- Data coming from JSON service
RPC call with parameters:
--> {"jsonrpc": "2.0", "method": "subtract", "params": [84, 42], "id": 1}
<-- {"jsonrpc": "2.0", "result": 42, "id": 1}
RPC call with named parameters:
--> {"jsonrpc": "2.0", "method": "subtract", "params": {"subtrahend": 42, "minuend":
84}, "id": 3}
<-- {"jsonrpc": "2.0", "result": 42, "id": 3}
Notification:
--> {"jsonrpc": "2.0", "method": "update", "params": [1,2,3,4,5]}
RPC call with invalid JSON:
--> {"jsonrpc": "2.0", "method": "foobar, "params": "bar", "baz]
<-- {"jsonrpc": "2.0", "error": {"code": -12345, "message": "Parse error."}, "id": null}
© Peter R. Egli 2015
10/11
Rev. 1.60
JSON-RPC indigoo.com
5. JSON-RPC 2.0 examples (2/2)
RPC call batch (multiple JSON requests mapped to one JSON packet):
--> [
{"jsonrpc": "2.0", "method": "sum", "params": [1,2,4], "id": "1"},
{"jsonrpc": "2.0", "method": "notify_hello", "params": [7]},
{"jsonrpc": "2.0", "method": "subtract", "params": [42,23], "id": "2"},
{"foo": "boo"},
{"jsonrpc": "2.0", "method": "foo.get", "params": {"name": "myself"}, "id": "5"},
{"jsonrpc": "2.0", "method": "get_data", "id": "9"}
]
© Peter R. Egli 2015
11/11
Rev. 1.60
JSON-RPC indigoo.com
6. When to use JSON-RPC
Applicability:
JSON-RPC is well suited for web service applications with the need for bidirectional interaction
(peer2peer), but where the complexity of SOAP is not required.
Example 1:
Remote management of devices over the Internet. SNMP (Simple Network Management
Protocol) would be the standard management protocol, but it is difficult to get through the
Internet due to the presence of firewalls.
Example 2:
Web application where the web server needs to update the client (server push).
JSON-RPC, as its name implies, was derived from Javascript. The client side of the application
is usually Javascript based (e.g. AJAX).

More Related Content

What's hot

REST & RESTful Web Service
REST & RESTful Web ServiceREST & RESTful Web Service
REST & RESTful Web ServiceHoan Vu Tran
 
Rest & RESTful WebServices
Rest & RESTful WebServicesRest & RESTful WebServices
Rest & RESTful WebServicesPrateek Tandon
 
gRPC and Microservices
gRPC and MicroservicesgRPC and Microservices
gRPC and MicroservicesJonathan Gomez
 
ASP.NET Web API
ASP.NET Web APIASP.NET Web API
ASP.NET Web APIhabib_786
 
Richardson Maturity and OpenAPI 3.0
Richardson Maturity and OpenAPI 3.0Richardson Maturity and OpenAPI 3.0
Richardson Maturity and OpenAPI 3.0SmartBear
 
Robert Kubis - gRPC - boilerplate to high-performance scalable APIs - code.t...
 Robert Kubis - gRPC - boilerplate to high-performance scalable APIs - code.t... Robert Kubis - gRPC - boilerplate to high-performance scalable APIs - code.t...
Robert Kubis - gRPC - boilerplate to high-performance scalable APIs - code.t...AboutYouGmbH
 
Distributed Programming using RMI
Distributed Programming using RMIDistributed Programming using RMI
Distributed Programming using RMIbackdoor
 
REST vs gRPC: Battle of API's
REST vs gRPC: Battle of API'sREST vs gRPC: Battle of API's
REST vs gRPC: Battle of API'sLuram Archanjo
 
Understanding REST APIs in 5 Simple Steps
Understanding REST APIs in 5 Simple StepsUnderstanding REST APIs in 5 Simple Steps
Understanding REST APIs in 5 Simple StepsTessa Mero
 
Introduction to the Web API
Introduction to the Web APIIntroduction to the Web API
Introduction to the Web APIBrad Genereaux
 

What's hot (20)

REST & RESTful Web Service
REST & RESTful Web ServiceREST & RESTful Web Service
REST & RESTful Web Service
 
Rest & RESTful WebServices
Rest & RESTful WebServicesRest & RESTful WebServices
Rest & RESTful WebServices
 
Building microservices with grpc
Building microservices with grpcBuilding microservices with grpc
Building microservices with grpc
 
API for Beginners
API for BeginnersAPI for Beginners
API for Beginners
 
gRPC and Microservices
gRPC and MicroservicesgRPC and Microservices
gRPC and Microservices
 
ASP.NET Web API
ASP.NET Web APIASP.NET Web API
ASP.NET Web API
 
GRPC.pptx
GRPC.pptxGRPC.pptx
GRPC.pptx
 
Richardson Maturity and OpenAPI 3.0
Richardson Maturity and OpenAPI 3.0Richardson Maturity and OpenAPI 3.0
Richardson Maturity and OpenAPI 3.0
 
Robert Kubis - gRPC - boilerplate to high-performance scalable APIs - code.t...
 Robert Kubis - gRPC - boilerplate to high-performance scalable APIs - code.t... Robert Kubis - gRPC - boilerplate to high-performance scalable APIs - code.t...
Robert Kubis - gRPC - boilerplate to high-performance scalable APIs - code.t...
 
gRPC with java
gRPC with javagRPC with java
gRPC with java
 
Distributed Programming using RMI
Distributed Programming using RMIDistributed Programming using RMI
Distributed Programming using RMI
 
REST vs gRPC: Battle of API's
REST vs gRPC: Battle of API'sREST vs gRPC: Battle of API's
REST vs gRPC: Battle of API's
 
Understanding REST APIs in 5 Simple Steps
Understanding REST APIs in 5 Simple StepsUnderstanding REST APIs in 5 Simple Steps
Understanding REST APIs in 5 Simple Steps
 
gRPC
gRPCgRPC
gRPC
 
Introduction to PHP
Introduction to PHPIntroduction to PHP
Introduction to PHP
 
Json
JsonJson
Json
 
RESTful Web Services
RESTful Web ServicesRESTful Web Services
RESTful Web Services
 
Introduction to JSON
Introduction to JSONIntroduction to JSON
Introduction to JSON
 
MERN PPT
MERN PPTMERN PPT
MERN PPT
 
Introduction to the Web API
Introduction to the Web APIIntroduction to the Web API
Introduction to the Web API
 

Viewers also liked

Java and the blockchain - introducing web3j
Java and the blockchain - introducing web3jJava and the blockchain - introducing web3j
Java and the blockchain - introducing web3jConor Svensson
 
Using RabbitMQ and Netty library to implement RPC protocol
Using RabbitMQ and Netty library to implement RPC protocolUsing RabbitMQ and Netty library to implement RPC protocol
Using RabbitMQ and Netty library to implement RPC protocolTho Q Luong Luong
 
Blockchain - Navigating this Game-Changing Technology
Blockchain - Navigating this Game-Changing TechnologyBlockchain - Navigating this Game-Changing Technology
Blockchain - Navigating this Game-Changing TechnologyConor Svensson
 
Netflix at-disney-09-26-2014
Netflix at-disney-09-26-2014Netflix at-disney-09-26-2014
Netflix at-disney-09-26-2014Monal Daxini
 
HTML5 Real Time and WebSocket Code Lab (SFHTML5, GTUGSF)
HTML5 Real Time and WebSocket Code Lab (SFHTML5, GTUGSF)HTML5 Real Time and WebSocket Code Lab (SFHTML5, GTUGSF)
HTML5 Real Time and WebSocket Code Lab (SFHTML5, GTUGSF)Peter Lubbers
 
Blockchain Coding Dojo - BlockchainHub Graz
Blockchain Coding Dojo - BlockchainHub GrazBlockchain Coding Dojo - BlockchainHub Graz
Blockchain Coding Dojo - BlockchainHub GrazBlockchainHub Graz
 
사례로 본 모바일 웹/앱 기획, 제작 과정 및 포인트
사례로 본 모바일 웹/앱 기획, 제작 과정 및 포인트사례로 본 모바일 웹/앱 기획, 제작 과정 및 포인트
사례로 본 모바일 웹/앱 기획, 제작 과정 및 포인트mosaicnet
 
모바일 서비스 기획 시작하기
모바일 서비스 기획 시작하기모바일 서비스 기획 시작하기
모바일 서비스 기획 시작하기Jae-hyung Park
 
REST vs. Messaging For Microservices
REST vs. Messaging For MicroservicesREST vs. Messaging For Microservices
REST vs. Messaging For MicroservicesEberhard Wolff
 
기획서 템플릿
기획서 템플릿기획서 템플릿
기획서 템플릿Jaewon Choi
 
제일기획 이마트 기획서
제일기획 이마트 기획서제일기획 이마트 기획서
제일기획 이마트 기획서Yerim An
 

Viewers also liked (11)

Java and the blockchain - introducing web3j
Java and the blockchain - introducing web3jJava and the blockchain - introducing web3j
Java and the blockchain - introducing web3j
 
Using RabbitMQ and Netty library to implement RPC protocol
Using RabbitMQ and Netty library to implement RPC protocolUsing RabbitMQ and Netty library to implement RPC protocol
Using RabbitMQ and Netty library to implement RPC protocol
 
Blockchain - Navigating this Game-Changing Technology
Blockchain - Navigating this Game-Changing TechnologyBlockchain - Navigating this Game-Changing Technology
Blockchain - Navigating this Game-Changing Technology
 
Netflix at-disney-09-26-2014
Netflix at-disney-09-26-2014Netflix at-disney-09-26-2014
Netflix at-disney-09-26-2014
 
HTML5 Real Time and WebSocket Code Lab (SFHTML5, GTUGSF)
HTML5 Real Time and WebSocket Code Lab (SFHTML5, GTUGSF)HTML5 Real Time and WebSocket Code Lab (SFHTML5, GTUGSF)
HTML5 Real Time and WebSocket Code Lab (SFHTML5, GTUGSF)
 
Blockchain Coding Dojo - BlockchainHub Graz
Blockchain Coding Dojo - BlockchainHub GrazBlockchain Coding Dojo - BlockchainHub Graz
Blockchain Coding Dojo - BlockchainHub Graz
 
사례로 본 모바일 웹/앱 기획, 제작 과정 및 포인트
사례로 본 모바일 웹/앱 기획, 제작 과정 및 포인트사례로 본 모바일 웹/앱 기획, 제작 과정 및 포인트
사례로 본 모바일 웹/앱 기획, 제작 과정 및 포인트
 
모바일 서비스 기획 시작하기
모바일 서비스 기획 시작하기모바일 서비스 기획 시작하기
모바일 서비스 기획 시작하기
 
REST vs. Messaging For Microservices
REST vs. Messaging For MicroservicesREST vs. Messaging For Microservices
REST vs. Messaging For Microservices
 
기획서 템플릿
기획서 템플릿기획서 템플릿
기획서 템플릿
 
제일기획 이마트 기획서
제일기획 이마트 기획서제일기획 이마트 기획서
제일기획 이마트 기획서
 

Similar to JSON-RPC - JSON Remote Procedure Call

Teach your (micro)services talk Protocol Buffers with gRPC.
Teach your (micro)services talk Protocol Buffers with gRPC.Teach your (micro)services talk Protocol Buffers with gRPC.
Teach your (micro)services talk Protocol Buffers with gRPC.Mihai Iachimovschi
 
Yet another json rpc library (mole rpc)
Yet another json rpc library (mole rpc)Yet another json rpc library (mole rpc)
Yet another json rpc library (mole rpc)Viktor Turskyi
 
Blockchain Meetup- Introduction to dApps and the steps involved to create a d...
Blockchain Meetup- Introduction to dApps and the steps involved to create a d...Blockchain Meetup- Introduction to dApps and the steps involved to create a d...
Blockchain Meetup- Introduction to dApps and the steps involved to create a d...Techracers
 
Sun RPC (Remote Procedure Call)
Sun RPC (Remote Procedure Call)Sun RPC (Remote Procedure Call)
Sun RPC (Remote Procedure Call)Peter R. Egli
 
Consuming RESTful Web services in PHP
Consuming RESTful Web services in PHPConsuming RESTful Web services in PHP
Consuming RESTful Web services in PHPZoran Jeremic
 
Consuming RESTful services in PHP
Consuming RESTful services in PHPConsuming RESTful services in PHP
Consuming RESTful services in PHPZoran Jeremic
 
Fast and Reliable Swift APIs with gRPC
Fast and Reliable Swift APIs with gRPCFast and Reliable Swift APIs with gRPC
Fast and Reliable Swift APIs with gRPCTim Burks
 
Use perl creating web services with xml rpc
Use perl creating web services with xml rpcUse perl creating web services with xml rpc
Use perl creating web services with xml rpcJohnny Pork
 
Everybody Polyglot! - Cross-Language RPC with Erlang
Everybody Polyglot! - Cross-Language RPC with ErlangEverybody Polyglot! - Cross-Language RPC with Erlang
Everybody Polyglot! - Cross-Language RPC with ErlangRusty Klophaus
 
Cap'n Proto (C++ Developer Meetup Iasi)
Cap'n Proto (C++ Developer Meetup Iasi)Cap'n Proto (C++ Developer Meetup Iasi)
Cap'n Proto (C++ Developer Meetup Iasi)Ovidiu Farauanu
 
[Reactive] Programming with [Rx]ROS
[Reactive] Programming with [Rx]ROS[Reactive] Programming with [Rx]ROS
[Reactive] Programming with [Rx]ROSAndrzej Wasowski
 
Robot Operating Systems (Ros) Overview &amp; (1)
Robot Operating Systems (Ros) Overview &amp; (1)Robot Operating Systems (Ros) Overview &amp; (1)
Robot Operating Systems (Ros) Overview &amp; (1)Piyush Chand
 
Robot operating systems (ros) overview & (1)
Robot operating systems (ros) overview & (1)Robot operating systems (ros) overview & (1)
Robot operating systems (ros) overview & (1)Piyush Chand
 
Communication Protocols And Web Services
Communication Protocols And Web ServicesCommunication Protocols And Web Services
Communication Protocols And Web ServicesOmer Katz
 
PLNOG 18 - Piotr Wojciechowski - REST API czyli jak miękko wejść w programowa...
PLNOG 18 - Piotr Wojciechowski - REST API czyli jak miękko wejść w programowa...PLNOG 18 - Piotr Wojciechowski - REST API czyli jak miękko wejść w programowa...
PLNOG 18 - Piotr Wojciechowski - REST API czyli jak miękko wejść w programowa...PROIDEA
 
Claire protorpc
Claire protorpcClaire protorpc
Claire protorpcFan Robbin
 

Similar to JSON-RPC - JSON Remote Procedure Call (20)

Teach your (micro)services talk Protocol Buffers with gRPC.
Teach your (micro)services talk Protocol Buffers with gRPC.Teach your (micro)services talk Protocol Buffers with gRPC.
Teach your (micro)services talk Protocol Buffers with gRPC.
 
Yet another json rpc library (mole rpc)
Yet another json rpc library (mole rpc)Yet another json rpc library (mole rpc)
Yet another json rpc library (mole rpc)
 
Blockchain Meetup- Introduction to dApps and the steps involved to create a d...
Blockchain Meetup- Introduction to dApps and the steps involved to create a d...Blockchain Meetup- Introduction to dApps and the steps involved to create a d...
Blockchain Meetup- Introduction to dApps and the steps involved to create a d...
 
Sun RPC (Remote Procedure Call)
Sun RPC (Remote Procedure Call)Sun RPC (Remote Procedure Call)
Sun RPC (Remote Procedure Call)
 
Consuming RESTful Web services in PHP
Consuming RESTful Web services in PHPConsuming RESTful Web services in PHP
Consuming RESTful Web services in PHP
 
Consuming RESTful services in PHP
Consuming RESTful services in PHPConsuming RESTful services in PHP
Consuming RESTful services in PHP
 
Day01 api
Day01   apiDay01   api
Day01 api
 
XML-RPC and SOAP (April 2003)
XML-RPC and SOAP (April 2003)XML-RPC and SOAP (April 2003)
XML-RPC and SOAP (April 2003)
 
Fast and Reliable Swift APIs with gRPC
Fast and Reliable Swift APIs with gRPCFast and Reliable Swift APIs with gRPC
Fast and Reliable Swift APIs with gRPC
 
Use perl creating web services with xml rpc
Use perl creating web services with xml rpcUse perl creating web services with xml rpc
Use perl creating web services with xml rpc
 
Json
JsonJson
Json
 
Week4 lec1-bscs1
Week4 lec1-bscs1Week4 lec1-bscs1
Week4 lec1-bscs1
 
Everybody Polyglot! - Cross-Language RPC with Erlang
Everybody Polyglot! - Cross-Language RPC with ErlangEverybody Polyglot! - Cross-Language RPC with Erlang
Everybody Polyglot! - Cross-Language RPC with Erlang
 
Cap'n Proto (C++ Developer Meetup Iasi)
Cap'n Proto (C++ Developer Meetup Iasi)Cap'n Proto (C++ Developer Meetup Iasi)
Cap'n Proto (C++ Developer Meetup Iasi)
 
[Reactive] Programming with [Rx]ROS
[Reactive] Programming with [Rx]ROS[Reactive] Programming with [Rx]ROS
[Reactive] Programming with [Rx]ROS
 
Robot Operating Systems (Ros) Overview &amp; (1)
Robot Operating Systems (Ros) Overview &amp; (1)Robot Operating Systems (Ros) Overview &amp; (1)
Robot Operating Systems (Ros) Overview &amp; (1)
 
Robot operating systems (ros) overview & (1)
Robot operating systems (ros) overview & (1)Robot operating systems (ros) overview & (1)
Robot operating systems (ros) overview & (1)
 
Communication Protocols And Web Services
Communication Protocols And Web ServicesCommunication Protocols And Web Services
Communication Protocols And Web Services
 
PLNOG 18 - Piotr Wojciechowski - REST API czyli jak miękko wejść w programowa...
PLNOG 18 - Piotr Wojciechowski - REST API czyli jak miękko wejść w programowa...PLNOG 18 - Piotr Wojciechowski - REST API czyli jak miękko wejść w programowa...
PLNOG 18 - Piotr Wojciechowski - REST API czyli jak miękko wejść w programowa...
 
Claire protorpc
Claire protorpcClaire protorpc
Claire protorpc
 

More from Peter R. Egli

LPWAN Technologies for Internet of Things (IoT) and M2M Scenarios
LPWAN Technologies for Internet of Things (IoT) and M2M ScenariosLPWAN Technologies for Internet of Things (IoT) and M2M Scenarios
LPWAN Technologies for Internet of Things (IoT) and M2M ScenariosPeter R. Egli
 
Data Networking Concepts
Data Networking ConceptsData Networking Concepts
Data Networking ConceptsPeter R. Egli
 
Communication middleware
Communication middlewareCommunication middleware
Communication middlewarePeter R. Egli
 
Transaction Processing Monitors (TPM)
Transaction Processing Monitors (TPM)Transaction Processing Monitors (TPM)
Transaction Processing Monitors (TPM)Peter R. Egli
 
Business Process Model and Notation (BPMN)
Business Process Model and Notation (BPMN)Business Process Model and Notation (BPMN)
Business Process Model and Notation (BPMN)Peter R. Egli
 
Microsoft .NET Platform
Microsoft .NET PlatformMicrosoft .NET Platform
Microsoft .NET PlatformPeter R. Egli
 
Overview of Cloud Computing
Overview of Cloud ComputingOverview of Cloud Computing
Overview of Cloud ComputingPeter R. Egli
 
MQTT - MQ Telemetry Transport for Message Queueing
MQTT - MQ Telemetry Transport for Message QueueingMQTT - MQ Telemetry Transport for Message Queueing
MQTT - MQ Telemetry Transport for Message QueueingPeter R. Egli
 
Enterprise Application Integration Technologies
Enterprise Application Integration TechnologiesEnterprise Application Integration Technologies
Enterprise Application Integration TechnologiesPeter R. Egli
 
Overview of Microsoft .Net Remoting technology
Overview of Microsoft .Net Remoting technologyOverview of Microsoft .Net Remoting technology
Overview of Microsoft .Net Remoting technologyPeter R. Egli
 
Android Native Development Kit
Android Native Development KitAndroid Native Development Kit
Android Native Development KitPeter R. Egli
 
Overview of SCTP (Stream Control Transmission Protocol)
Overview of SCTP (Stream Control Transmission Protocol)Overview of SCTP (Stream Control Transmission Protocol)
Overview of SCTP (Stream Control Transmission Protocol)Peter R. Egli
 
Overview of SCTP (Stream Control Transmission Protocol)
Overview of SCTP (Stream Control Transmission Protocol)Overview of SCTP (Stream Control Transmission Protocol)
Overview of SCTP (Stream Control Transmission Protocol)Peter R. Egli
 
Overview of Spanning Tree Protocol (STP & RSTP)
Overview of Spanning Tree Protocol (STP & RSTP)Overview of Spanning Tree Protocol (STP & RSTP)
Overview of Spanning Tree Protocol (STP & RSTP)Peter R. Egli
 
MSMQ - Microsoft Message Queueing
MSMQ - Microsoft Message QueueingMSMQ - Microsoft Message Queueing
MSMQ - Microsoft Message QueueingPeter R. Egli
 
Common Object Request Broker Architecture - CORBA
Common Object Request Broker Architecture - CORBACommon Object Request Broker Architecture - CORBA
Common Object Request Broker Architecture - CORBAPeter R. Egli
 
Component Object Model (COM, DCOM, COM+)
Component Object Model (COM, DCOM, COM+)Component Object Model (COM, DCOM, COM+)
Component Object Model (COM, DCOM, COM+)Peter R. Egli
 
JMS - Java Messaging Service
JMS - Java Messaging ServiceJMS - Java Messaging Service
JMS - Java Messaging ServicePeter R. Egli
 
REST - Representational State Transfer
REST - Representational State TransferREST - Representational State Transfer
REST - Representational State TransferPeter R. Egli
 

More from Peter R. Egli (20)

LPWAN Technologies for Internet of Things (IoT) and M2M Scenarios
LPWAN Technologies for Internet of Things (IoT) and M2M ScenariosLPWAN Technologies for Internet of Things (IoT) and M2M Scenarios
LPWAN Technologies for Internet of Things (IoT) and M2M Scenarios
 
Data Networking Concepts
Data Networking ConceptsData Networking Concepts
Data Networking Concepts
 
Communication middleware
Communication middlewareCommunication middleware
Communication middleware
 
Transaction Processing Monitors (TPM)
Transaction Processing Monitors (TPM)Transaction Processing Monitors (TPM)
Transaction Processing Monitors (TPM)
 
Business Process Model and Notation (BPMN)
Business Process Model and Notation (BPMN)Business Process Model and Notation (BPMN)
Business Process Model and Notation (BPMN)
 
Microsoft .NET Platform
Microsoft .NET PlatformMicrosoft .NET Platform
Microsoft .NET Platform
 
Overview of Cloud Computing
Overview of Cloud ComputingOverview of Cloud Computing
Overview of Cloud Computing
 
MQTT - MQ Telemetry Transport for Message Queueing
MQTT - MQ Telemetry Transport for Message QueueingMQTT - MQ Telemetry Transport for Message Queueing
MQTT - MQ Telemetry Transport for Message Queueing
 
Enterprise Application Integration Technologies
Enterprise Application Integration TechnologiesEnterprise Application Integration Technologies
Enterprise Application Integration Technologies
 
Overview of Microsoft .Net Remoting technology
Overview of Microsoft .Net Remoting technologyOverview of Microsoft .Net Remoting technology
Overview of Microsoft .Net Remoting technology
 
Android Native Development Kit
Android Native Development KitAndroid Native Development Kit
Android Native Development Kit
 
Overview of SCTP (Stream Control Transmission Protocol)
Overview of SCTP (Stream Control Transmission Protocol)Overview of SCTP (Stream Control Transmission Protocol)
Overview of SCTP (Stream Control Transmission Protocol)
 
Overview of SCTP (Stream Control Transmission Protocol)
Overview of SCTP (Stream Control Transmission Protocol)Overview of SCTP (Stream Control Transmission Protocol)
Overview of SCTP (Stream Control Transmission Protocol)
 
Web services
Web servicesWeb services
Web services
 
Overview of Spanning Tree Protocol (STP & RSTP)
Overview of Spanning Tree Protocol (STP & RSTP)Overview of Spanning Tree Protocol (STP & RSTP)
Overview of Spanning Tree Protocol (STP & RSTP)
 
MSMQ - Microsoft Message Queueing
MSMQ - Microsoft Message QueueingMSMQ - Microsoft Message Queueing
MSMQ - Microsoft Message Queueing
 
Common Object Request Broker Architecture - CORBA
Common Object Request Broker Architecture - CORBACommon Object Request Broker Architecture - CORBA
Common Object Request Broker Architecture - CORBA
 
Component Object Model (COM, DCOM, COM+)
Component Object Model (COM, DCOM, COM+)Component Object Model (COM, DCOM, COM+)
Component Object Model (COM, DCOM, COM+)
 
JMS - Java Messaging Service
JMS - Java Messaging ServiceJMS - Java Messaging Service
JMS - Java Messaging Service
 
REST - Representational State Transfer
REST - Representational State TransferREST - Representational State Transfer
REST - Representational State Transfer
 

Recently uploaded

"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 

Recently uploaded (20)

"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 

JSON-RPC - JSON Remote Procedure Call

  • 1. © Peter R. Egli 2015 1/11 Rev. 1.60 JSON-RPC indigoo.com Peter R. Egli INDIGOO.COM JSON-RPC JSON REMOTE PROCEDURE CALL OVERVIEW OF JSON-RPC, A VERY SIMPLE AND LIGHTWEIGHT RPC PROTOCOL FOR DISTRIBUTED APPLICATIONS
  • 2. © Peter R. Egli 2015 2/11 Rev. 1.60 JSON-RPC indigoo.com Contents 1. What is JSON-RPC? 2. JSON-RPC interactions 3. Transport options for JSON-RPC 4. JSON serialization format 5. JSON-RPC 2.0 examples 6. When to use JSON-RPC
  • 3. © Peter R. Egli 2015 3/11 Rev. 1.60 JSON-RPC indigoo.com 1. What is JSON-RPC? JSON-RPC is a simple RPC mechanism, similar to XML-RPC. Protocol: Unlike XML-RPC which is a client-server protocol, JSON-RPC is a peer-to-peer protocol. It uses JSON (Javascript Object Notation, RFC4627) as the serialization format and plain TCP streams or HTTP as transport mechanism. JSON message types: JSON-RPC defines 3 message types: Request: Method invokation with arguments encoded in JSON. Response: Reply to method invokation containing the return argument encoded in JSON. Notification: Asynchronous request without response. Specification: JSON-RPC is very simple, i.e. the JSON-RPC specification is very short (ca. 5 pages). See http://json-rpc.org/.
  • 4. © Peter R. Egli 2015 4/11 Rev. 1.60 JSON-RPC indigoo.com 2. JSON-RPC interactions JSON-RPC defines 2 message exchange patterns that support most of the usual peer2peer interaction schemes. A. Request-Response: The sending JSON peer invokes a method on the remote JSON peer with a JSON request. The remote peer sends back a JSON response message. B. Notification: The sending peer sends a single notification message. There is no response message. JSON peer Request (REQ) Response (RSP) method params id Method to be invoked. Request message: Arguments to be passed to method as an array of objects. Request ID to match request and response. result error id Object returned by the called method. Response message: Error object if an error occurred. Request ID to match request and response. Notification (NOT) method params id Method to be invoked. Notification message: Arguments to be passed to method as an array of objects. Must be null (nothing to match). JSON peer JSON peer JSON peer
  • 5. © Peter R. Egli 2015 5/11 Rev. 1.60 JSON-RPC indigoo.com 3. Transport options for JSON-RPC (1/2) JSON does not require a specific transport protocol. The JSON-RPC standard defines 2 transport protocols for conveying JSON messages. A. TCP stream (default transport): The JSON-RPC default transport is a simple TCP stream (JSON-RPC exchanges serialized objects over plain TCP sockets). JSON -RPC peer JSON -RPC peer REQ1NOT1 RSP1 REQ2 NOT2 RSP2 TCP stream connection (2 unidirectional connections)
  • 6. © Peter R. Egli 2015 6/11 Rev. 1.60 JSON-RPC indigoo.com 3. Transport options for JSON-RPC (2/2) B. HTTP connection: Here an HTTP connection is used as a transport channel. The HTTP-request is used as transport container for JSON-request (REQ), JSON-responses (RSP) and JSON-notification (NOT) messages that are sent from the JSON-peer with the HTTP client. Likewise the HTTP-response is used for transporting JSON-messages from the JSON- peer with the HTTP server. N.B.: There is no mapping of JSON request to HTTP-request. HTTP is merely the transport mechanism. The HTTP client and server will need to use a long polling scheme so the server always has a response ready to use for a RSP, REQ or NOT message. HTTP client JSON -RPC peer HTTP server REQ1NOT1 JSON -RPC peer NOT1REQ1 HTTP GET request REQ1NOT1 RSP1 REQ2 NOT2RSP1 REQ2NOT2 HTTP response RSP1 REQ2 NOT2 RSP2 RSP2 HTTP POST request RSP2
  • 7. © Peter R. Egli 2015 7/11 Rev. 1.60 JSON-RPC indigoo.com 4. JSON serialization format (1/2) JSON (Javascript Object Notation, RFC4627) is a lightweight, text-based, language-independent data exchange format. JSON text is a sequence of tokens. JSON types: 1. Primitive types: string Sequence of 0..n Unicode characters, enclosed in quotation marks. Example: „hello world“ number Numerical value (represention as used in most programming languages). Examples: 3.45, 5E3 boolean true / false value null Null value (= no object or no value) 2. Structured types: Array Ordered sequence of 0..n values. Example: [1,3,4] Object Unordered collection of 0..n name:value pairs. Name = string Value = string, number, boolean, null, object, array. Example: {"jsonrpc": "2.0", "method": "update", "params": [1,2,3,4,5]} Encoding: JSON text is encoded in Unicode. The default encoding is UTF-8.
  • 8. © Peter R. Egli 2015 8/11 Rev. 1.60 JSON-RPC indigoo.com 4. JSON serialization format (2/2) JSON grammar expressed in ABNF (excerpt only, ABNF syntax see RFC5234): JSON-text = object / array; begin-array = ws %x5B ws ; [ left square bracket begin-object = ws %x7B ws ; { left curly bracket end-array = ws %x5D ws ; ] right square bracket end-object = ws %x7D ws ; } right curly bracket name-separator = ws %x3A ws ; : colon value-separator = ws %x2C ws ; , comma whitespace = *{%x20 / %x09 / %x0A / %X0d) value = false / null / true / object / array / number / string false = %x66.61.6c.73.65 ; false null = %x6e.75.6c.6c ; null true = %x74.72.75.65 ; true object = begin-object [ member *( value-separator member ) ] end-object member = string name-separator value array = begin-array [ value *( value-separator value ) ] end-array number = [ minus ] int [ frac ] [ exp ] string = quotation-mark *char quotation-mark
  • 9. © Peter R. Egli 2015 9/11 Rev. 1.60 JSON-RPC indigoo.com 5. JSON-RPC 2.0 examples (1/2) Notation: --> Data sent to JSON service <-- Data coming from JSON service RPC call with parameters: --> {"jsonrpc": "2.0", "method": "subtract", "params": [84, 42], "id": 1} <-- {"jsonrpc": "2.0", "result": 42, "id": 1} RPC call with named parameters: --> {"jsonrpc": "2.0", "method": "subtract", "params": {"subtrahend": 42, "minuend": 84}, "id": 3} <-- {"jsonrpc": "2.0", "result": 42, "id": 3} Notification: --> {"jsonrpc": "2.0", "method": "update", "params": [1,2,3,4,5]} RPC call with invalid JSON: --> {"jsonrpc": "2.0", "method": "foobar, "params": "bar", "baz] <-- {"jsonrpc": "2.0", "error": {"code": -12345, "message": "Parse error."}, "id": null}
  • 10. © Peter R. Egli 2015 10/11 Rev. 1.60 JSON-RPC indigoo.com 5. JSON-RPC 2.0 examples (2/2) RPC call batch (multiple JSON requests mapped to one JSON packet): --> [ {"jsonrpc": "2.0", "method": "sum", "params": [1,2,4], "id": "1"}, {"jsonrpc": "2.0", "method": "notify_hello", "params": [7]}, {"jsonrpc": "2.0", "method": "subtract", "params": [42,23], "id": "2"}, {"foo": "boo"}, {"jsonrpc": "2.0", "method": "foo.get", "params": {"name": "myself"}, "id": "5"}, {"jsonrpc": "2.0", "method": "get_data", "id": "9"} ]
  • 11. © Peter R. Egli 2015 11/11 Rev. 1.60 JSON-RPC indigoo.com 6. When to use JSON-RPC Applicability: JSON-RPC is well suited for web service applications with the need for bidirectional interaction (peer2peer), but where the complexity of SOAP is not required. Example 1: Remote management of devices over the Internet. SNMP (Simple Network Management Protocol) would be the standard management protocol, but it is difficult to get through the Internet due to the presence of firewalls. Example 2: Web application where the web server needs to update the client (server push). JSON-RPC, as its name implies, was derived from Javascript. The client side of the application is usually Javascript based (e.g. AJAX).