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

Therefore, the official XML-RPC standard does not support 64-bit values. But in these modern times, 64-bit values ​​are more and more common.

How do you deal with this? Which XML-RPC extensions are the most common? What language bindings exist? I'm particularly interested in Python and C ++, but all information is welcome.

+4
source share
4 answers

Some libraries support 64-bit extensions, but there seems to be no standard. xmlrpc-c , for example, has the so-called i8, but it does not work with python (at least not by default).

I would recommend either:

  • Convert the integer to a string manually and send it as such. XMLRPC converts it to a string anyway, so I would say that is reasonable.
  • Divide it into two 32-bit integers and send them as such.
+7
source

Using "i8" as a data type is becoming more common. I recently added this to my XML-RPC module for Perl ( http://metacpan.org/pod/RPC::XML ) in response to a request from a large group that needed it to work with a server written in Java . I do not know what toolkit the server used, but it already accepted i8 as a type.

One thing that I feel still needs to be resolved is whether the alliance "int" for "i4" should also accept i8, as it is doing i4 now. Or, for that matter, if the parameter entered as i8 should calmly accept the input entered as i4. XML-RPC has great potential as a lightweight, low-maintenance protocol when you don't need all of SOAP coverage, but it is often overlooked in the religious wars between REST and SOAP.

XML-RPC needs some updating and revision if we could just get the author of the original to allow it ...

+1
source

I don’t know anything about how to extend XMLRPC, but I found this post about the subject:

In XML-RPC, everything is passed as a string, so I don’t think the choice is really that bad - except for the course for the extra clumsiness to invoke an explicit function conversion.

But no, XML-RPC does not have a data type that can represent integers above 2 ** 32. If you can accept the loss of precision, you can use doubling (but you still have to convert explicitly to the sender).

0
source

XML-RPC.NET has been supporting <i8> since version 2.5.0 (September 5, 2010).

0
source

Source: https://habr.com/ru/post/1276971/


All Articles