• 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> -> rtc_Boolean

    5) <VALUE>, <STRING> -> rtc_String

    6) <DOUBLE> -> rtc_Float

    7) <DATETIME.ISO8601>, <DATETIME>, <TIMESTAMP> -> rtc_DateTime

    8) <BASE64>, <BASE64BINARY>, <BINARY> -> rtc_ByteStream

    9) <STRUCT> -> rtc_Record; Except if it is the first and the only parameter in a function call list, in which case all values will be prepared as named parameters, "the standard RTC way".

    10) <ARRAY> -> rtc_Array

    11) </NIL> -> rtc_Null

    Best Regards,
    Danijel Tkalcec
  • 相关阅读:
    oculus按键大全
    10 soundJs 初体验
    09 获取服务器时间
    08 基本数据类型转换
    07 如果再使用animateCC2018或者苹果系统使用animate时出现Uncaught ReferenceError: lib is not defined的错误
    AS3.0和php数据交互POST方式
    06 显示fps帧频
    05 js利用ajax向服务器发送请求并返回json值
    04 ajax执行php并传递参数
    03php拉取服务器信息并生成json
  • 原文地址:https://www.cnblogs.com/liangchua/p/6595177.html
Copyright © 2020-2023  润新知