设为首页 加入收藏

TOP

XML-RPC vs. RTC Format(一)
2017-10-10 12:03:36 】 浏览:2327
Tags:XML-RPC vs. RTC Format

 Author XML-RPC vs. RTC Format
Danijel Tkalcec [RTC]

25.10.2006 11:49:37
Registered user
There are two major differences between the XML-RPC format and the RTC format.

One difference is that XML-RPC doesn't support all types supported by RTC, so multiple RTC types need to be mapped to a single XML-RPC type. Because of this, some type information will be "lost" when sending the data over XML-RPC. Here is a list showing how your RTC types will be mapped to XML-RPC when sending the data out ...

1) rtc_Float, rtc_Currency -> <double>

2) rtc_Integer, rtc_LargeInt -> <int>

3) rtc_Text, rtc_String, rtc_WideString, rtc_Variable -> <value>

4) rtc_DateTime -> <datetime.iso8601> (no miliseconds)

5) rtc_Boolean -> <boolean>

6) rtc_DataSet -> <struct> with "Fields" and "Rows" as <array>s

7) rtc_Exception -> <fault><struct>

8) rtc_Record -> <struct>

9) rtc_Array -> <array>

10) rtc_ByteStream -> <base64>

11) rtc_Null -> <nil/>

When RTC Clients need to talk to a RTC Server (and vice-versa), you can send all RTC types like DataSets and Exceptions as parameters and all other XML-RPC apps will be able to decipher the data, but other XML-RPC apps will most likely see the data "differently".

For example, a rtc_DataSet will be seen as a <struct> with two <array>s and not as a single DataSet object (like in RTC SDK), while Exceptions included in other data will be seen as a <struct> with 2 <member>s (unless it's a single Exception sent from the Server to the Client, for which the standard <fault> structure will be used).

You can also activate both data formats on the ServerModule (fmt_RTC and fmt_XMLRPC), so your RTC clients can use the compact RTC format while other apps use XML-RPC.

Another difference is that XML-RPC function call parameters are sent in a list, where order is important, but no names are assigned, while RTC uses names for all parameters. To make the communication between RTC Clients and Servers compatible even when using XML-RPC, all parameters will be packed into a <struct>, unless you pack them in an array called "params". That way, name information will be preserved if you use the "standard RTC way", and ... if you need to talk to a server/client which wants the parameters in a list, you will pack them into an array named "params", with the first parameter at index 0.

So, if a non-RTC app will want to call a remote function written with RTC by using names, it will have to send all parameters as a single <struct> param. On the other hand, when you want to call remote functions written by other servers, unless they use the same <struct> method, you will need to pack the data in an array called "params" (elements start from index 0).

That way we are keeping 100% compatibility between RTC clients and servers, while still making communication with other XML-RPC apps possible, regardless of their format.

Best Regards,
Danijel Tkalcec
Danijel Tkalcec [RTC]

25.10.2006 12:33:46
Registered user
Here is how XML-RPC types will be mappet to RTC types when you receive a request or a response over XML-RPC ...

1) <FAULT> -> rtc_Exception

2) <METHODCALL>, <CALL> -> rtc_Function

3) <I4>, <INT> -> rtc_LargeInt

4) <BOOLEAN> ->
首页 上一页 1 2 下一页 尾页 1/2/2
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇Server calling functions on cli.. 下一篇RTC相关文章收集

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目