69
RPC OVER INTERNET

RPC OVER INTERNETberaldi/PSD_013/JS.pdf · JSON-RPC 2.0 • JSON-RPC is a stateless, transport agnostic, light-weight remote procedure call (RPC) protocol • Much like XML-RPC •

  • Upload
    others

  • View
    34

  • Download
    0

Embed Size (px)

Citation preview

Page 1: RPC OVER INTERNETberaldi/PSD_013/JS.pdf · JSON-RPC 2.0 • JSON-RPC is a stateless, transport agnostic, light-weight remote procedure call (RPC) protocol • Much like XML-RPC •

RPC OVER INTERNET

Page 2: RPC OVER INTERNETberaldi/PSD_013/JS.pdf · JSON-RPC 2.0 • JSON-RPC is a stateless, transport agnostic, light-weight remote procedure call (RPC) protocol • Much like XML-RPC •

Web API: RPC over Internet• RPC calls mapped onto HTTP (GET or POST) • Synchronous call• Asynchronous call

• with callbacks

• External data representation• JSON (Java Simple Object Notation)

• http://www.json.org/json-it.html

• XML

• Protocols• REST, SOAP, JSONP, JSON-RPC, XML-RPC,…

Page 3: RPC OVER INTERNETberaldi/PSD_013/JS.pdf · JSON-RPC 2.0 • JSON-RPC is a stateless, transport agnostic, light-weight remote procedure call (RPC) protocol • Much like XML-RPC •

JSON

Page 4: RPC OVER INTERNETberaldi/PSD_013/JS.pdf · JSON-RPC 2.0 • JSON-RPC is a stateless, transport agnostic, light-weight remote procedure call (RPC) protocol • Much like XML-RPC •

JSON• Two fundamental structures:

See JSON Lint

Page 5: RPC OVER INTERNETberaldi/PSD_013/JS.pdf · JSON-RPC 2.0 • JSON-RPC is a stateless, transport agnostic, light-weight remote procedure call (RPC) protocol • Much like XML-RPC •

XML in a nutshell • XML (eXtensible Markup Language) is a language derived

from SGML (Standard Generalized Markup Language),from which HTML also derives.

• The key notion in the markup language familty is amarkup, something that describes some aspect of themarkup, something that describes some aspect of thedata

• In HTML markups define the appearance of thedocument, whereas in XML they define the meaning ofthe data

Page 6: RPC OVER INTERNETberaldi/PSD_013/JS.pdf · JSON-RPC 2.0 • JSON-RPC is a stateless, transport agnostic, light-weight remote procedure call (RPC) protocol • Much like XML-RPC •

XML in a nutshell• An XML document is a tree

• Data appear inside elements

• An element not only contains the data itself but alsoinformation describing the meaning of the datainformation describing the meaning of the data

Page 7: RPC OVER INTERNETberaldi/PSD_013/JS.pdf · JSON-RPC 2.0 • JSON-RPC is a stateless, transport agnostic, light-weight remote procedure call (RPC) protocol • Much like XML-RPC •

Example

Il Signore degli Anelli, di John Ronald Reuel Tolkien,

Bompiani.

Title

Author di John Ronald Reuel Tolkien, Bompiani.

Editor

Page 8: RPC OVER INTERNETberaldi/PSD_013/JS.pdf · JSON-RPC 2.0 • JSON-RPC is a stateless, transport agnostic, light-weight remote procedure call (RPC) protocol • Much like XML-RPC •

Example<book>

<title> Il Signore degli Anelli

</title><author>

John R. R. Tolkien</author>

Title

Author

Editor

Book Elements

</author><editore>

Bompiani</editor>

</book>

Editor

Tips : Browser allows to see the structure of the document

Page 9: RPC OVER INTERNETberaldi/PSD_013/JS.pdf · JSON-RPC 2.0 • JSON-RPC is a stateless, transport agnostic, light-weight remote procedure call (RPC) protocol • Much like XML-RPC •

Elements and attribute<title>

Il Signore degli Anelli</title>

Data

Attribute (key/value pair)Tag

<title pages=“345”> Il Signore degli Anelli

</title>

Attribute (key/value pair)

Page 10: RPC OVER INTERNETberaldi/PSD_013/JS.pdf · JSON-RPC 2.0 • JSON-RPC is a stateless, transport agnostic, light-weight remote procedure call (RPC) protocol • Much like XML-RPC •

Well formed document

Page 11: RPC OVER INTERNETberaldi/PSD_013/JS.pdf · JSON-RPC 2.0 • JSON-RPC is a stateless, transport agnostic, light-weight remote procedure call (RPC) protocol • Much like XML-RPC •

Valid document• Document that follows composition rules about the its

structure• Two solutions• Document Type Definition

• Easier, less ‘powerfull’• Easier, less ‘powerfull’

• XML Schema• More complex, more powerfull

Page 12: RPC OVER INTERNETberaldi/PSD_013/JS.pdf · JSON-RPC 2.0 • JSON-RPC is a stateless, transport agnostic, light-weight remote procedure call (RPC) protocol • Much like XML-RPC •

WFD and validation

XMLDocument

Syntax check

Semantic check

Grammar

Page 13: RPC OVER INTERNETberaldi/PSD_013/JS.pdf · JSON-RPC 2.0 • JSON-RPC is a stateless, transport agnostic, light-weight remote procedure call (RPC) protocol • Much like XML-RPC •

XML-RPC

Page 14: RPC OVER INTERNETberaldi/PSD_013/JS.pdf · JSON-RPC 2.0 • JSON-RPC is a stateless, transport agnostic, light-weight remote procedure call (RPC) protocol • Much like XML-RPC •

Overview of XML-RPC• Data Model

• Scalar• Struct• Array

• Messages• Messages• Request message• Response message• Error message

Page 15: RPC OVER INTERNETberaldi/PSD_013/JS.pdf · JSON-RPC 2.0 • JSON-RPC is a stateless, transport agnostic, light-weight remote procedure call (RPC) protocol • Much like XML-RPC •

Scalar types

Tag Type Example

<i4> or <int> four-byte signed integer -12

<boolean> 0 (false) or 1 (true) 1

<string> string hello world

<double> double-precision signed floating point number

-12.214

<dateTime.iso8601> date/time 20101504T09:30:00

<base64> base64-encoded binary eW91IGNhbid0IHJlYWQgdGhpcyE=

Page 16: RPC OVER INTERNETberaldi/PSD_013/JS.pdf · JSON-RPC 2.0 • JSON-RPC is a stateless, transport agnostic, light-weight remote procedure call (RPC) protocol • Much like XML-RPC •

Struct type

<struct><member>

<name>lowerBound</name><value><i4>18</i4></value>

</member>

<member><name>upperBound</name><value><i4>139</i4></value>

</member></struct>

Page 17: RPC OVER INTERNETberaldi/PSD_013/JS.pdf · JSON-RPC 2.0 • JSON-RPC is a stateless, transport agnostic, light-weight remote procedure call (RPC) protocol • Much like XML-RPC •

Array type

<array><data>

<value><i4>12</i4></value><value><string>Egypt</string></value><value><boolean>0</boolean></value><value><i4>-31</i4></value>

</data></array>

Page 18: RPC OVER INTERNETberaldi/PSD_013/JS.pdf · JSON-RPC 2.0 • JSON-RPC is a stateless, transport agnostic, light-weight remote procedure call (RPC) protocol • Much like XML-RPC •

Request message

• Root element: methodCall• contains a MethodName element and a paramselement

• MethodName contains the name of the procedure • MethodName contains the name of the procedure being called

• Params is a list of values for the parameters

Page 19: RPC OVER INTERNETberaldi/PSD_013/JS.pdf · JSON-RPC 2.0 • JSON-RPC is a stateless, transport agnostic, light-weight remote procedure call (RPC) protocol • Much like XML-RPC •

Example<?xml version="1.0"?>

<methodCall>

<methodName>XXX</methodName>

<params>

<param>

<value><i4>123</i4></value>

</param>

<param> <param>

<value><double>12.3</double></value>

</param>

</params>

</methodCall>

Page 20: RPC OVER INTERNETberaldi/PSD_013/JS.pdf · JSON-RPC 2.0 • JSON-RPC is a stateless, transport agnostic, light-weight remote procedure call (RPC) protocol • Much like XML-RPC •

Example<?xml version="1.0"?>

<methodCall>

<methodName> XXX</methodName>

<params>

<param>

<value><i4>123</i4></value>

</param>

<param>

<value><double>12.3</double></value>

methodCall

XXX

methodName

params

param value i4123<value><double>12.3</double></value>

</param>

</params>

</methodCall>param value double

123

12.3

Page 21: RPC OVER INTERNETberaldi/PSD_013/JS.pdf · JSON-RPC 2.0 • JSON-RPC is a stateless, transport agnostic, light-weight remote procedure call (RPC) protocol • Much like XML-RPC •

Example<?xml version="1.0"?>

<methodCall>

<methodName>Scuola XXX</methodName>

<params>

<param>

<value><i4>123</i4></value>

</param>

<param>

<value><double>12.3</double></value>

methodCall

XXX

methodName

params

param value i4123<value><double>12.3</double></value>

</param>

</params>

</methodCall>param value double

123

12.3

methodNameparams

paramparam

doublei4

methodCall

Page 22: RPC OVER INTERNETberaldi/PSD_013/JS.pdf · JSON-RPC 2.0 • JSON-RPC is a stateless, transport agnostic, light-weight remote procedure call (RPC) protocol • Much like XML-RPC •

Complete request messagePOST /xmlrpc HTTP 1.0User-Agent: …Host: …Content-type: text/xmlContent-length: ..

<?xml version=“1.0”?><methodCall><methodName>Circle_Area</methodName><params><param><value><double>12.2</double></value><param><params></methodCall>

Page 23: RPC OVER INTERNETberaldi/PSD_013/JS.pdf · JSON-RPC 2.0 • JSON-RPC is a stateless, transport agnostic, light-weight remote procedure call (RPC) protocol • Much like XML-RPC •

Reply message

<?xml version="1.0"?>

<methodResponse>

<params>

<param>

<value><i4>1</i4></value><value><i4>1</i4></value>

</param>

</params>

</methodResponse>

Page 24: RPC OVER INTERNETberaldi/PSD_013/JS.pdf · JSON-RPC 2.0 • JSON-RPC is a stateless, transport agnostic, light-weight remote procedure call (RPC) protocol • Much like XML-RPC •

Fault message<?xml version="1.0"?><methodResponse>

<fault><value>

<struct><member>

<name>faultCode</name><value><int>4</int></value><value><int>4</int></value></member>

<member><name>faultString</name><value><string>Too many parameters.</string></value></member>

</struct></value>

</fault></methodResponse>

Page 25: RPC OVER INTERNETberaldi/PSD_013/JS.pdf · JSON-RPC 2.0 • JSON-RPC is a stateless, transport agnostic, light-weight remote procedure call (RPC) protocol • Much like XML-RPC •

JSON-RPC 2.0• JSON-RPC is a stateless, transport agnostic, light-weight

remote procedure call (RPC) protocol• Much like XML-RPC

• No formal grammar• Definition of request object and reply object• Definition of request object and reply object

• New feature: batch requests, notification

Page 26: RPC OVER INTERNETberaldi/PSD_013/JS.pdf · JSON-RPC 2.0 • JSON-RPC is a stateless, transport agnostic, light-weight remote procedure call (RPC) protocol • Much like XML-RPC •

Some example --> {"jsonrpc": "2.0", "method": "subtract", "params": [42, 23], "id": 1}<-- {"jsonrpc": "2.0", "result": 19, "id": 1}

-->{"jsonrpc": "2.0", "method": "subtract", "params": [23, 42], "id": 2}<-- {"jsonrpc": "2.0", "result": -19, "id": 2}

-->{"jsonrpc": "2.0", "method": "subtract", "params": {"subtrahend": 23, "minuend": 42}, "id": 3}<-- {"jsonrpc": "2.0", "result": 19, "id": 3}

--> {"jsonrpc": "2.0", "method": "subtract", "params": {"minuend": 42, "subtrahend": 23}, "id": 4}<-- {"jsonrpc": "2.0", "result": 19, "id": 4}

Page 27: RPC OVER INTERNETberaldi/PSD_013/JS.pdf · JSON-RPC 2.0 • JSON-RPC is a stateless, transport agnostic, light-weight remote procedure call (RPC) protocol • Much like XML-RPC •

JSON-RPC call batch --> [

{"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"} {"jsonrpc": "2.0", "method": "get_data", "id": "9"} ]<-- [{"jsonrpc": "2.0", "result": 7, "id": "1"},{"jsonrpc": "2.0", "result": 19, "id": "2"},{"jsonrpc": "2.0", "error": {"code": -32600, "message": "InvalidRequest."}, "id": null},{"jsonrpc": "2.0", "error": {"code": -32601, "message": "Method notfound."}, "id": "5"},{"jsonrpc": "2.0", "result": ["hello", 5], "id": "9"}]

Page 28: RPC OVER INTERNETberaldi/PSD_013/JS.pdf · JSON-RPC 2.0 • JSON-RPC is a stateless, transport agnostic, light-weight remote procedure call (RPC) protocol • Much like XML-RPC •

JSONP (JSON with Padding)

GET

f(JSON data)

….<javasxcript scr=xxx&callback=f>….

Used in JavaScriptAllows to overcome the cross-domain problemUses a callback function

Page 29: RPC OVER INTERNETberaldi/PSD_013/JS.pdf · JSON-RPC 2.0 • JSON-RPC is a stateless, transport agnostic, light-weight remote procedure call (RPC) protocol • Much like XML-RPC •

REST• Method calls are mapped to HTTP request (Get, Post)• Method name is a parameter of the call• Reply is usually formatted as JSON or XML

Page 30: RPC OVER INTERNETberaldi/PSD_013/JS.pdf · JSON-RPC 2.0 • JSON-RPC is a stateless, transport agnostic, light-weight remote procedure call (RPC) protocol • Much like XML-RPC •

SOAP• It’s by far the most verbose protocol• Service is described in WSDL file • Messages as XML documents formatted according to a

specific schema

Page 31: RPC OVER INTERNETberaldi/PSD_013/JS.pdf · JSON-RPC 2.0 • JSON-RPC is a stateless, transport agnostic, light-weight remote procedure call (RPC) protocol • Much like XML-RPC •

Tool utili per il debugging

Page 32: RPC OVER INTERNETberaldi/PSD_013/JS.pdf · JSON-RPC 2.0 • JSON-RPC is a stateless, transport agnostic, light-weight remote procedure call (RPC) protocol • Much like XML-RPC •

RCP over Internet: example

…Features

geolookup conditions forecast

types= JSON, XML

http://api.wunderground.com/api/http://api.wunderground.com/api/http://api.wunderground.com/api/http://api.wunderground.com/api/KEYKEYKEYKEY////FEATUREFEATUREFEATUREFEATURE/[/[/[/[FEATUREFEATUREFEATUREFEATURE…]/q/…]/q/…]/q/…]/q/QUERYQUERYQUERYQUERY....FORMATFORMATFORMATFORMAT

Page 33: RPC OVER INTERNETberaldi/PSD_013/JS.pdf · JSON-RPC 2.0 • JSON-RPC is a stateless, transport agnostic, light-weight remote procedure call (RPC) protocol • Much like XML-RPC •

Examplehttp://api.wunderground.com/api/[API_KEY]/conditions/q/rome.json

….

location ID

http://api.wunderground.com/api/[API_KEY]/conditions/q/rome.json?callback=f

JSONP

Page 34: RPC OVER INTERNETberaldi/PSD_013/JS.pdf · JSON-RPC 2.0 • JSON-RPC is a stateless, transport agnostic, light-weight remote procedure call (RPC) protocol • Much like XML-RPC •

Example of XML replyhttp://api.wunderground.com/api/[APIKEY]/conditions/q/zmw:00000.1.16240.xml

Page 35: RPC OVER INTERNETberaldi/PSD_013/JS.pdf · JSON-RPC 2.0 • JSON-RPC is a stateless, transport agnostic, light-weight remote procedure call (RPC) protocol • Much like XML-RPC •

Interoperability

Chrome Developer tool

Page 36: RPC OVER INTERNETberaldi/PSD_013/JS.pdf · JSON-RPC 2.0 • JSON-RPC is a stateless, transport agnostic, light-weight remote procedure call (RPC) protocol • Much like XML-RPC •

Static call • Using JS src you can “make a call” and display results on

the screen•

Page 37: RPC OVER INTERNETberaldi/PSD_013/JS.pdf · JSON-RPC 2.0 • JSON-RPC is a stateless, transport agnostic, light-weight remote procedure call (RPC) protocol • Much like XML-RPC •

Static call

Page 38: RPC OVER INTERNETberaldi/PSD_013/JS.pdf · JSON-RPC 2.0 • JSON-RPC is a stateless, transport agnostic, light-weight remote procedure call (RPC) protocol • Much like XML-RPC •

Dynamic Call

Page 39: RPC OVER INTERNETberaldi/PSD_013/JS.pdf · JSON-RPC 2.0 • JSON-RPC is a stateless, transport agnostic, light-weight remote procedure call (RPC) protocol • Much like XML-RPC •

Dynamic call

1. Dynamically create a HTML element and append in the head section

2. Call the URL with callback function

Page 40: RPC OVER INTERNETberaldi/PSD_013/JS.pdf · JSON-RPC 2.0 • JSON-RPC is a stateless, transport agnostic, light-weight remote procedure call (RPC) protocol • Much like XML-RPC •

Dynamic call

Show the current temperature on the screen• Show the current temperature on the screen

Page 41: RPC OVER INTERNETberaldi/PSD_013/JS.pdf · JSON-RPC 2.0 • JSON-RPC is a stateless, transport agnostic, light-weight remote procedure call (RPC) protocol • Much like XML-RPC •

Using jQuery

Page 42: RPC OVER INTERNETberaldi/PSD_013/JS.pdf · JSON-RPC 2.0 • JSON-RPC is a stateless, transport agnostic, light-weight remote procedure call (RPC) protocol • Much like XML-RPC •

Additional example

Page 43: RPC OVER INTERNETberaldi/PSD_013/JS.pdf · JSON-RPC 2.0 • JSON-RPC is a stateless, transport agnostic, light-weight remote procedure call (RPC) protocol • Much like XML-RPC •

Additional example

Page 44: RPC OVER INTERNETberaldi/PSD_013/JS.pdf · JSON-RPC 2.0 • JSON-RPC is a stateless, transport agnostic, light-weight remote procedure call (RPC) protocol • Much like XML-RPC •

Example: Geocoding API

Page 45: RPC OVER INTERNETberaldi/PSD_013/JS.pdf · JSON-RPC 2.0 • JSON-RPC is a stateless, transport agnostic, light-weight remote procedure call (RPC) protocol • Much like XML-RPC •

Example: Geocoding API (json)

Page 46: RPC OVER INTERNETberaldi/PSD_013/JS.pdf · JSON-RPC 2.0 • JSON-RPC is a stateless, transport agnostic, light-weight remote procedure call (RPC) protocol • Much like XML-RPC •

Example: Geocoding API (xml)

Page 47: RPC OVER INTERNETberaldi/PSD_013/JS.pdf · JSON-RPC 2.0 • JSON-RPC is a stateless, transport agnostic, light-weight remote procedure call (RPC) protocol • Much like XML-RPC •

Example: reverse Geocoding (json)

Page 48: RPC OVER INTERNETberaldi/PSD_013/JS.pdf · JSON-RPC 2.0 • JSON-RPC is a stateless, transport agnostic, light-weight remote procedure call (RPC) protocol • Much like XML-RPC •

Example: Reverse geocoding (xml)

Page 49: RPC OVER INTERNETberaldi/PSD_013/JS.pdf · JSON-RPC 2.0 • JSON-RPC is a stateless, transport agnostic, light-weight remote procedure call (RPC) protocol • Much like XML-RPC •

Google’s JavaScript API (vers. 3)

Page 50: RPC OVER INTERNETberaldi/PSD_013/JS.pdf · JSON-RPC 2.0 • JSON-RPC is a stateless, transport agnostic, light-weight remote procedure call (RPC) protocol • Much like XML-RPC •

Example

Page 51: RPC OVER INTERNETberaldi/PSD_013/JS.pdf · JSON-RPC 2.0 • JSON-RPC is a stateless, transport agnostic, light-weight remote procedure call (RPC) protocol • Much like XML-RPC •

Example:

Page 52: RPC OVER INTERNETberaldi/PSD_013/JS.pdf · JSON-RPC 2.0 • JSON-RPC is a stateless, transport agnostic, light-weight remote procedure call (RPC) protocol • Much like XML-RPC •

Geolocation in HTML5

Page 53: RPC OVER INTERNETberaldi/PSD_013/JS.pdf · JSON-RPC 2.0 • JSON-RPC is a stateless, transport agnostic, light-weight remote procedure call (RPC) protocol • Much like XML-RPC •

Example: Flickr ®

Page 54: RPC OVER INTERNETberaldi/PSD_013/JS.pdf · JSON-RPC 2.0 • JSON-RPC is a stateless, transport agnostic, light-weight remote procedure call (RPC) protocol • Much like XML-RPC •

Flickr: request, reply message format

http://api.flickr.com/services/xmlrpc/

http://api.flickr.com/services/soap/

WEB-API

http://api.flickr.com/services/rest/

Page 55: RPC OVER INTERNETberaldi/PSD_013/JS.pdf · JSON-RPC 2.0 • JSON-RPC is a stateless, transport agnostic, light-weight remote procedure call (RPC) protocol • Much like XML-RPC •

Example: rest call

Page 56: RPC OVER INTERNETberaldi/PSD_013/JS.pdf · JSON-RPC 2.0 • JSON-RPC is a stateless, transport agnostic, light-weight remote procedure call (RPC) protocol • Much like XML-RPC •

Example

• Reply is wrapped through jsonFlickrApi callback name• To avoid this, set nojsoncallback=1 option

json format

Page 57: RPC OVER INTERNETberaldi/PSD_013/JS.pdf · JSON-RPC 2.0 • JSON-RPC is a stateless, transport agnostic, light-weight remote procedure call (RPC) protocol • Much like XML-RPC •

Asynchronous RPC: AJAX

Sicurezza:Cross domain non è consentito

Page 58: RPC OVER INTERNETberaldi/PSD_013/JS.pdf · JSON-RPC 2.0 • JSON-RPC is a stateless, transport agnostic, light-weight remote procedure call (RPC) protocol • Much like XML-RPC •

Example: using AJAX

Page 59: RPC OVER INTERNETberaldi/PSD_013/JS.pdf · JSON-RPC 2.0 • JSON-RPC is a stateless, transport agnostic, light-weight remote procedure call (RPC) protocol • Much like XML-RPC •

Example: using AJAX

Page 60: RPC OVER INTERNETberaldi/PSD_013/JS.pdf · JSON-RPC 2.0 • JSON-RPC is a stateless, transport agnostic, light-weight remote procedure call (RPC) protocol • Much like XML-RPC •

Example: searching photos

Page 61: RPC OVER INTERNETberaldi/PSD_013/JS.pdf · JSON-RPC 2.0 • JSON-RPC is a stateless, transport agnostic, light-weight remote procedure call (RPC) protocol • Much like XML-RPC •

Example: searching photos

Page 62: RPC OVER INTERNETberaldi/PSD_013/JS.pdf · JSON-RPC 2.0 • JSON-RPC is a stateless, transport agnostic, light-weight remote procedure call (RPC) protocol • Much like XML-RPC •

Example: searching data

Key photo contains photo details

Page 63: RPC OVER INTERNETberaldi/PSD_013/JS.pdf · JSON-RPC 2.0 • JSON-RPC is a stateless, transport agnostic, light-weight remote procedure call (RPC) protocol • Much like XML-RPC •

Example: searching photo

Every photo has a link[mstzb] defines the size

Page 64: RPC OVER INTERNETberaldi/PSD_013/JS.pdf · JSON-RPC 2.0 • JSON-RPC is a stateless, transport agnostic, light-weight remote procedure call (RPC) protocol • Much like XML-RPC •

Example: searching photos

Page 65: RPC OVER INTERNETberaldi/PSD_013/JS.pdf · JSON-RPC 2.0 • JSON-RPC is a stateless, transport agnostic, light-weight remote procedure call (RPC) protocol • Much like XML-RPC •

Other example

http://api.wordreference.com/{api_version}/{API_key}/{dictionary}/{term}

http://api.wordreference.com/{api_version}/{API_key}/JSON/{dictionary}/{term}

Page 66: RPC OVER INTERNETberaldi/PSD_013/JS.pdf · JSON-RPC 2.0 • JSON-RPC is a stateless, transport agnostic, light-weight remote procedure call (RPC) protocol • Much like XML-RPC •

Example

Page 67: RPC OVER INTERNETberaldi/PSD_013/JS.pdf · JSON-RPC 2.0 • JSON-RPC is a stateless, transport agnostic, light-weight remote procedure call (RPC) protocol • Much like XML-RPC •

Example

Page 68: RPC OVER INTERNETberaldi/PSD_013/JS.pdf · JSON-RPC 2.0 • JSON-RPC is a stateless, transport agnostic, light-weight remote procedure call (RPC) protocol • Much like XML-RPC •

Example: Twitter API

Page 69: RPC OVER INTERNETberaldi/PSD_013/JS.pdf · JSON-RPC 2.0 • JSON-RPC is a stateless, transport agnostic, light-weight remote procedure call (RPC) protocol • Much like XML-RPC •

Exercise

• Write a simple JS program for the TTT game• Hint:

• use a table for button formatting• Use a single handler to make modification