[Standards] JSON-RPC over XMPP? / XEP-0335: JSON Containers

Dave Cridland dave at cridland.net
Fri Feb 21 13:13:41 UTC 2014


On 21 Feb 2014 07:25, "Christian Schudt" <christian.schudt at gmx.de> wrote:
>
> Hi,
>
> we are using a custom JSON transport protocol in order to JSON-RPC (
http://en.wikipedia.org/wiki/JSON-RPC).
>
> It is very similar to XEP-0009 (Jabber-RPC), but uses JSON instead of
XML. (It's much easier to transport complex return values or parameters
with JSON-RPC than with XML-RPC.)
>
> Just recently I saw that there is XEP-0335: JSON Containers and I wonder
if anybody has thought about combining it with JSON-RPC?
>
> Something like:
>
> <iq to="recipient.example.com" type="set" id="q1">
>       <query xmlns="urn:xmpp:json-rpc">
>         <json xmlns="urn:xmpp:json:0">
>           { "method": "myMethodName" }
>         </json>
>       </query>
> </iq>
>

This seems reasonable. I'd like to see it written up as a XEP, with
discovery etc covered.

> Another question: It's probably unnecessary to wrap the json element into
another element. Can urn:xmpp:json be used as direct child of IQ in order
to signal "this is a JSON-RPC"? Like:
>
> <iq to="recipient.example.com" type="set" id="q1">
>         <json xmlns="urn:xmpp:json:0">
>           { "method": "myMethodName" }
>         </json>
> </iq>
>
> Well, sure it can, but I mean, are there any ideas to push this to a more
standard way? Like adding a section in XEP-335 which says: If a json
element is included as direct child in an IQ-set, than the JSON content
SHOULD/MUST be conform to JSON-RPC?
>

So this implies that the main, or sole, use of JSON as the IQ payload would
be JSON-RPC. Other uses would need a wrapper element.

It's not clear to me that this is a good thing. I'd particularly not want
to see XEP-0335 include a JSON-RPC/XMPP transport definition, in any case.

I don't know enough about the requirements of a JSON-RPC transport to know
if it's technically a good choice from that perspective; I'm willing to
believe it'd be fine, but I'm aware that many protocols initially deployed
over HTTP make assumptions about the HTTP modelthat might require further
metadata; this might be worth examining.

Dave.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.jabber.org/pipermail/standards/attachments/20140221/92ce72ea/attachment.html>


More information about the Standards mailing list