XML-RPC

XML -RPC (Extensible Markup Language Remote Procedure Call) is a definition of the method call (or function call ) by Distributed Systems.

  • 3.1 request
  • 3.2 Answer

General

The specification of attention has been paid to an implementation of XML -RPC without much effort in different programming languages ​​and on different platforms is possible. For this reason, two classes were combined to implement: for the transport of the data was on the Hypertext Transfer Protocol (HTTP ) as possible, while the representation of the data transmitted in the Extensible Markup Language (XML) occurs.

The choice of these standards is also a key difference from older RPC mechanisms such as RPC, CORBA or DCOM is where the data for the most part ( system-dependent part: DCOM) in a binary representation can be transmitted via special communication protocols.

Historically provides XML -RPC is the predecessor to SOAP, is contrary to this, however, much leaner and faster to understand.

There are numerous implementations for many of today's popular programming languages ​​that incorporate the basic functionality of the method call and the methods treatment. To the basic functionality in these libraries include:

  • Representation of data types,
  • Generation and analysis of call - and response packets
  • Transmission and reception thereof and
  • Often " to Life " of the program code and the provision of skeleton and stub for easy.

The following data types are defined in XML - RPC:

Several of these simple data types can be combined using " struct" and "array". A "struct" in this case represents a collection of key-value pairs; definitely contained value can therefore be accessed by a unique key value. An "array" is instead an list; each value contained is here described clearly about his position. In addition to simple data types "struct" s and "array" s, in turn, "struct" s and "array" s included as values ​​; it is thus possible to represent arbitrarily complex data structures.

In Java, the is the "struct" appropriate data type called Map ( java.util.Map ). In the implementations, however, the class HashTable is usually used to represent that implements the Map interface, but even longer exists in Java. The the "array" corresponding data type in Java is the so-called List ( java.util.List ) or an Object array.

Extensions to the standard

There are a variety of extensions to the standard to include alleged gaps in the standard. Usually, however, these extensions are based on a misunderstanding of what XML -RPC, and jeopardize interoperability of different systems. Therefore, most implementations offer a switch to switch in a compatibility mode, in which only the standard is supported.

Null data type

The representations of so-called zero - values ​​(also known as NIL, NULL or NUL ) is not possible with XML -RPC. Methods must therefore always return a specific value, in rare cases, this can be a problem. There are different extensions of the XML - RPC standards in order to fix this problem, but these extensions are not supported by all servers and clients. ( See, for example. )

Examples

Inquiry

      warenkorb.addPosition                   monitor < / value>                     10 < / value>             reply

                    OK < / string> < / value>             Code Example: Linux Documentation Project

17862
de