I saw in the specification that method names starting with "rpc." are
reserved for extensions
This restriction doesn't exist for property names of object
parameters...
It could... Even if it is allowed by JSON and works in JavaScript,
object property names rarely use the dot "." character
So, to prevent any conflict with object parameter with a "date" or
"base64" property name, they might become as this :
base64 value:
XML -> <base64>eW91IGNhbid0IHJlYWQgdGhpcyE=</base64>
JSON -> {"rpc.base64": "eW91IGNhbid0IHJlYWQgdGhpcyE="}
date/time value:
XML -> <dateTime.iso8601>19980717T14:08:55</dateTime.iso8601>
JSON -> {"rpc.dateTime": "19980717T14:08:55"}
As nil can be exposed as <NIL /> or <EX:NIL />, If the server already
provided XML-RPC with an implementation of NIL, it should still use
the same (and should its clients)
Otherwise It is up to the implementation to provide a default notation
from these both, and a way for the administrator to provide any of
them
Clients and servers can send themselves an information of which
notation it prefer:
Example over HTTP:
via HTTP headers
POST /RPC HTTP/1.0
Host:
betty.userland.com
Accept: text/xml, application/json-rpc
X-Accept-Nil: EX:NIL, NIL
Content-Type: text/xml
Content-length: 181
<?xml version="1.0"?>
<methodCall>
<methodName>examples.getStateName</methodName>
<params>
<param> <value><i4>41</i4></value> </param>
</params>
</methodCall>
Here the client says to the server it accept both notations for NIL
X-Accept-Nil: EX:NIL, NIL
via the QueryString
POST /RPC?accept-nil=ex:nil HTTP/1.0
...
here the client says to the server it only support the "<EX:NIL />"
notation
The second technique is easier to implement for existing XML-RPC
clients as they just have to adjust the URL they call
So a server supporting XML-RPC and JSON-RPC can expose all its RPC
method to both services