views:

569

answers:

3

So the official XML-RPC standard doesn't support 64-bit values. But in these modern times, 64-bit values are increasingly common.

How do you handle these? What XML-RPC extensions are the most common? What language bindings are there? I'm especially interested in Python and C++, but all information is appreciated.

A: 

I don't know anything about how XMLRPC could be extended but I did find this mail about the subject:

In XML-RPC, everything is transmitted as a string, so I don't think that choice is really that bad - except of course for the additional clumsiness for invoking explicit conversion functions.

But no, XML-RPC doesn't have a data type that can represent integers above 2**32. If you can accept losing precision, you can use doubles (but you still would have to convert explicitly on the sender).

Douglas Leeder
+7  A: 

Some libraries support 64 bits extensions, indeed, but there doesn't seem to be a standard. xmlrpc-c, for example, has a so called i8 but it doesn't work with python (at least not by default).

I would recommend to either:

  • Convert the integer to string by hand and send it as such. XMLRPC will convert it to string anyway, so I would say this is reasonable.
  • Break it in two 32 bits integers and send it as such.
tsg
+1  A: 

The use of "i8" as a data-type is becoming more and more common. I recently added this to my Perl XML-RPC module (http://search.cpan.org/dist/RPC-XML) in response to a request from a large group that needed it in order to work with a server written in Java. I don't know what toolkit the server used, but it was already accepting i8 as a type.

One thing that I feel still has to be addressed, is whether the "int" alias for "i4" should also accept i8, the way it currently does i4. Or, for that matter, if a parameter typed as i8 should quietly accept an input typed as i4. XML-RPC has great potential as a lightweight, low-overhead protocol handy when you don't need all the coverage of SOAP, but it is often overlooked in the religious wars between REST and SOAP.

XML-RPC is in need of some updating and revision, if we could just get the original author to permit it...

rjray