Hi all,
First off a big salute everyone that's doing work on JSON-RPC - it's a
great effort and the spec is looking good so far.
I've seen several JSON-RPC implementations mentioned for client-server
and server-server communication (browsers being the clients), but
haven't seen anything for intra-browser communication. With the client-
side of web applications becoming more and more distributed to a set
of isolated components (widgets) there's also a need for mechanisms
that enable communication between these components. A lot of groups
and projects (OpenAjax, OpenSocial and Shindig, W3C widgets) are
poking at this problem on various levels, from low-level communication
primitives (postMessage, server-side proxied communication, cookies,
URL fragments) to high-level abstractions (messaging, rpc, pub-sub,
shared memory) and even new browser architectures (MS Gazelle and
Chromium).
What a colleague of mine and I have been working on is pmrpc - an open-
source JSON-RPC implementation in JavaScript using HTML5 postMessage
API for transport. The pmrpc library provides a simple API for
exposing and calling procedures from windows or iFrames on different
domains, and also provides several advanced features like callbacks,
ACL-based access control and automatic retries. For those who aren't
familiar with the postMessage API - it's an API introduced in HTML5
which enables windows and iframes within a browser to exchange
messages in a secure way (basically by sending messages and checking
from which domains these messages come from).
Pmrpc implements the JSON-RPC 2.0 spec in full (notifications, named
parameters, errors, etc), except for Batch calls since there is still
a lot of discussion going on about this feature. Nevertheless, we'd
like to see batch calls in pmrpc one day as well. Also, the JSON-RPC
implementation (JSON-RPC messages) is hidden behind a more user-
friendly API, but the API could have easily accepted JSON-RPC requests/
responses as parameters.
For more information please visit the project homepage -
http://code.google.com/p/pmrpc/ (there's a few notes on JSON-RPC
implementation in the API docs -
http://code.google.com/p/pmrpc/wiki/PmrpcApiDocs#Implementation).
Feedback and discussions are appreciated. :)
Thanks,
Ivan
P.S Does anyone know what happened to JSON.com? I pinged Ric Johnson
(@openajax) but he's not answering.