XML-RPC
Encyclopedia
XML-RPC is a remote procedure call
Remote procedure call
In computer science, a remote procedure call is an inter-process communication that allows a computer program to cause a subroutine or procedure to execute in another address space without the programmer explicitly coding the details for this remote interaction...

 (RPC) protocol which uses XML
XML
Extensible Markup Language is a set of rules for encoding documents in machine-readable form. It is defined in the XML 1.0 Specification produced by the W3C, and several other related specifications, all gratis open standards....

 to encode its calls and HTTP as a transport mechanism. "XML-RPC" also refers generically to the use of XML for remote procedure call, independently of the specific protocol. This article is about the protocol named "XML-RPC".

History

XML-RPC, the protocol, was created in 1998 by Dave Winer
Dave Winer
Dave Winer is an American software developer, entrepreneur and writer in New York City. Winer is noted for his contributions to outliners, scripting, content management, and web services, as well as blogging and podcasting...

 of UserLand Software
UserLand Software
UserLand Software is a US software company founded by Dave Winer in 1988. UserLand sells Web content management and blogging software packages and services.-Company History:Dave Winer founded the company in 1988 after leaving Symantec in the spring of 1988...

 and Microsoft
Microsoft
Microsoft Corporation is an American public multinational corporation headquartered in Redmond, Washington, USA that develops, manufactures, licenses, and supports a wide range of products and services predominantly related to computing through its various product divisions...

. As new functionality was introduced, the standard evolved into what is now SOAP.

The generic use of XML for remote procedure call
Remote procedure call
In computer science, a remote procedure call is an inter-process communication that allows a computer program to cause a subroutine or procedure to execute in another address space without the programmer explicitly coding the details for this remote interaction...

 (RPC) was patented by Phillip Merrick
Phillip Merrick
Phillip Merrick was one of the original founders of webMethods, a high-flying company that went public during the Internet boom. Merrick attended Melbourne University in the early 1980s-References:...

, Stewart Allen, and Joseph Lapp in April 2006, claiming benefit to a provisional application filed in March 1998. The patent is assigned to webMethods
WebMethods
webMethods is an enterprise software company, acquired by Software AG, focused on application integration, business process integration and B2B partner integration. Founded in 1996, the company pioneered the use of web services to connect software applications together within a single organization...

, located in Fairfax, VA.

Usage

XML-RPC works by sending a HTTP request to a server implementing the protocol. The client in that case is typically software wanting to call a single method of a remote system. Multiple input parameters can be passed to the remote method, one return value is returned. The parameter types allow nesting of parameters into maps and lists, thus larger structures can be transported. Therefore XML-RPC can be used to transport objects or structures both as input and as output parameters.

Identification of clients for authorization purposes can be achieved using popular HTTP security methods. Basic access authentication is used for identification, HTTPS
Https
Hypertext Transfer Protocol Secure is a combination of the Hypertext Transfer Protocol with SSL/TLS protocol to provide encrypted communication and secure identification of a network web server...

 is used when identification (via certificates) and encrypted messages are needed. Both methods can be combined.

In comparison to REST
Rest
Rest may refer to:* Leisure* Human relaxation* SleepRest may also refer to:* Rest , a pause in a piece of music* Rest , the relation between two observers* Rest , a 2008 album by Gregor Samsa...

, where resources are transported, XML-RPC is designed to call methods.

XML-RPC is simpler to use and understand than SOAP because it
  • allows only one method of method serialization, whereas SOAP defines multiple different encodings
  • has a simpler security model
  • does not require (nor support) the creation of WSDL
    Web Services Description Language
    The Web Services Description Language is an XML-based language that is used for describing the functionality offered by a Web service. A WSDL description of a web service provides a machine-readable description of how the service can be called, what parameters it expects and what data structures...

     service descriptions, although XRDL provides a simple subset of the functionality provided by WSDL


JSON-RPC
JSON-RPC
JSON-RPC is a remote procedure call protocol encoded in JSON. It is a very simple protocol , defining only a handful of data types and commands...

 is similar to XML-RPC.

Data types

Common datatypes are converted into their XML equivalents with example values shown below:
Name Tag Example Description
array



1404
Something here
1


Array of values, storing no keys
base64

eW91IGNhbid0IHJlYWQgdGhpcyE=
Base64
Base64
Base64 is a group of similar encoding schemes that represent binary data in an ASCII string format by translating it into a radix-64 representation...

-encoded binary data
boolean

1
Boolean
Boolean datatype
In computer science, the Boolean or logical data type is a data type, having two values , intended to represent the truth values of logic and Boolean algebra...

 logical value (0 or 1)
date/time

19980717T14:08:55
Date and time in ISO 8601
ISO 8601
ISO 8601 Data elements and interchange formats – Information interchange – Representation of dates and times is an international standard covering the exchange of date and time-related data. It was issued by the International Organization for Standardization and was first published in 1988...

 format
double

-12.53
Double precision
Double precision
In computing, double precision is a computer number format that occupies two adjacent storage locations in computer memory. A double-precision number, sometimes simply called a double, may be defined to be an integer, fixed point, or floating point .Modern computers with 32-bit storage locations...

 floating point number
integer

42

or

42
Whole number, integer
Integer
The integers are formed by the natural numbers together with the negatives of the non-zero natural numbers .They are known as Positive and Negative Integers respectively...

string

Hello world!
String of characters. Must follow XML encoding.
struct



foo
1


bar
2


Associative array
Associative array
In computer science, an associative array is an abstract data type composed of a collection of pairs, such that each possible key appears at most once in the collection....

nil


Discriminated null value; an XML-RPC extension

Examples

An example of a typical XML-RPC request would be:



examples.getStateName


40





An example of a typical XML-RPC response would be:





South Dakota





A typical XML-RPC fault would be:







faultCode
4


faultString
Too many parameters.






Criticism

Critics of XML-RPC argue that RPC calls can be made with plain XML, (effectively this means REST
Rest
Rest may refer to:* Leisure* Human relaxation* SleepRest may also refer to:* Rest , a pause in a piece of music* Rest , the relation between two observers* Rest , a 2008 album by Gregor Samsa...

) and that XML-RPC doesn't add any value over XML. Both XML-RPC and XML require an application-level data model, such as which field names are defined in the XML schema or the parameter names in XML-RPC. Furthermore, XML-RPC uses about 4 times the number of bytes compared to plain XML to encode the same objects, which is itself bloated compared to JSON.

Python


C++


Objective-C / GNUstep / Cocoa


Erlang

  • XML-RPC for Erlang: This is an HTTP 1.1 compliant XML-RPC library for Erlang. It is designed to make it easy to write XML-RPC Erlang clients and/or servers. The library is compliant with the XML-RPC specification published by http://www.xmlrpc.org/

Java


JavaScript


XMPP

  • pyJabberXMLRPC: Python classes for XMPP
  • Jabber-RPC: Over the Extensible Messaging and Presence Protocol
    Extensible Messaging and Presence Protocol
    Extensible Messaging and Presence Protocol is an open-standard communications protocol for message-oriented middleware based on XML . The protocol was originally named Jabber, and was developed by the Jabber open-source community in 1999 for near-real-time, extensible instant messaging , presence...

     protocol

Perl

  • RPC::XML: A set of Perl classes for core data, message and XML handling
  • Frontier-RPC: Another set of Perl modules for XML-RPC client/server implementation
  • XML::RPC: Perl module implementation

PHP


Other


See also

  • Ajax (programming)
    Ajax (programming)
    Ajax is a group of interrelated web development methods used on the client-side to create asynchronous web applications...

  • Component technologies
  • List of web service markup languages
  • OPML
    OPML
    OPML is an XML format for outlines...

  • Web service
    Web service
    A Web service is a method of communication between two electronic devices over the web.The W3C defines a "Web service" as "a software system designed to support interoperable machine-to-machine interaction over a network". It has an interface described in a machine-processable format...


External links

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK