Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

XML-RPC: best way to handle 64-bit values?

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.

like image 928
Mark Harrison Avatar asked Mar 01 '23 07:03

Mark Harrison


2 Answers

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.
like image 73
tsg Avatar answered Mar 03 '23 21:03

tsg


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://metacpan.org/pod/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...

like image 22
rjray Avatar answered Mar 03 '23 22:03

rjray