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

Christian Schudt christian.schudt at gmx.de
Fri Feb 21 12:25:17 UTC 2014


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>

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?


Regards,
Christian



More information about the Standards mailing list