[go: nahoru, domu]

Jump to content

XML-RPC: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
m clean up; http->https (see this RfC) using AWB
GreenC bot (talk | contribs)
Rescued 1 archive link. Wayback Medic 2.5 per WP:URLREQ#google.com/patents
 
(36 intermediate revisions by 24 users not shown)
Line 1: Line 1:
{{Short description|Data serialization format}}
{{Use dmy dates|date=October 2012}}
'''XML-RPC''' is a [[remote procedure call]] (RPC) [[Communications protocol|protocol]] which uses [[XML]] to encode its calls and [[HTTP]] as a transport mechanism.<ref name="book1">Simon St. Laurent, Joe Johnston, Edd Dumbill. (June 2001) ''Programming Web Services with XML-RPC.'' O'Reilly. First Edition.</ref> "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".
{{Distinguish|text = the use of XML for RPC, independently of the specific protocol. This article is about the protocol named "XML-RPC"}}
{{More citations needed|date=October 2016}}
{{Use dmy dates|date=December 2021}}
'''XML-RPC''' is a [[remote procedure call]] (RPC) [[Communications protocol|protocol]] which uses [[XML]] to encode its calls and [[HTTP]] as a transport mechanism.<ref name="book1">Simon St. Laurent, Joe Johnston, Edd Dumbill. (June 2001) ''Programming Web Services with XML-RPC.'' O'Reilly. First Edition.</ref>


==History==
==History==
The XML-RPC protocol was created in 1998 by [[Dave Winer]] of [[UserLand Software]] and [[Microsoft]],<ref>{{cite web
The XML-RPC protocol was created in 1998 by [[Dave Winer]] of [[UserLand Software]] and [[Microsoft]],<ref>{{cite web|last=Box|first=Don|title=A Brief History of SOAP
|publisher=[[O'Reilly Media|O'Reilly]]|date=1 April 2001|url=http://www.xml.com/pub/a/ws/2001/04/04/soap.html
|last=Box
|access-date=27 October 2010}}</ref> with Microsoft seeing the protocol as an essential part of scaling up its efforts in business-to-business e-commerce.<ref>{{Cite web|last=Rupley |first=Sebastian |title=XML's Next Step |work=PC Magazine |access-date=2015-11-17 |date=1999-06-30 |url=http://www.zdnet.com/pcmag/stories/trends/0,7607,2286488,00.html |url-status=dead |archive-url=https://web.archive.org/web/20000304215507/http://www.zdnet.com/pcmag/stories/trends/0,7607,2286488,00.html |archive-date=4 March 2000 }}</ref> As new functionality was introduced, the standard evolved into what is now [[SOAP (protocol)|SOAP]].<ref name=spearheads>{{Cite news|last=Walsh |first=Jeff |title=Microsoft spearheads protocol push |work=Infoworld |access-date=2015-11-17 |date=1999-07-10 |url=http://www.infoworld.com/cgi-bin/displayStory.pl?980710.whsoap.htm |url-status=dead |archive-url=https://web.archive.org/web/19990914001234/http://www.infoworld.com/cgi-bin/displayStory.pl?980710.whsoap.htm |archive-date=14 September 1999 }}</ref>
|first=Don
|title=A Brief History of SOAP
|publisher=[[O'Reilly]]
|date=1 April 2001
|url=http://www.xml.com/pub/a/ws/2001/04/04/soap.html
|accessdate=27 October 2010}}</ref> with Microsoft seeing the protocol as an essential part of scaling up its efforts in business-to-business e-commerce.<ref>{{Cite web|last=Rupley |first=Sebastian |title=XML's Next Step |work=PC Magazine |accessdate=2015-11-17 |date=1999-06-30 |url=http://www.zdnet.com/pcmag/stories/trends/0,7607,2286488,00.html |deadurl=yes |archiveurl=https://web.archive.org/web/20000304215507/http://www.zdnet.com/pcmag/stories/trends/0,7607,2286488,00.html |archivedate=4 March 2000 }}</ref> As new functionality was introduced, the standard evolved into what is now [[SOAP (protocol)|SOAP]].<ref name=spearheads>{{Cite news|last=Walsh |first=Jeff |title=Microsoft spearheads protocol push |work=Infoworld |accessdate=2015-11-17 |date=1999-07-10 |url=http://www.infoworld.com/cgi-bin/displayStory.pl?980710.whsoap.htm |deadurl=yes |archiveurl=https://web.archive.org/web/19990914001234/http://www.infoworld.com/cgi-bin/displayStory.pl?980710.whsoap.htm |archivedate=14 September 1999 }}</ref>


UserLand supported XML-RPC from version 5.1 of its Frontier web content management system,<ref name=spearheads /> released in June 1998.<ref>{{cite web| last = Walsh| first = Jeff| title = UserLand releases Frontier 5.1, drops freeware model | work = InfoWorld| accessdate =November 17, 2015| date = June 29, 1998| url = http://www.infoworld.com/cgi-bin/displayStory.pl?980629.wifrontier.htm |archiveurl = https://web.archive.org/web/19990915175718/http://www.infoworld.com/cgi-bin/displayStory.pl?980629.wifrontier.htm |archivedate = September 15, 1999}}</ref>
UserLand supported XML-RPC from version 5.1 of its Frontier web content management system,<ref name=spearheads /> released in June 1998.<ref>{{cite web| last = Walsh| first = Jeff| title = UserLand releases Frontier 5.1, drops freeware model | work = InfoWorld| access-date =17 November 2015| date = 29 June 1998| url = http://www.infoworld.com/cgi-bin/displayStory.pl?980629.wifrontier.htm |archive-url = https://web.archive.org/web/19990915175718/http://www.infoworld.com/cgi-bin/displayStory.pl?980629.wifrontier.htm |archive-date=15 September 1999 }}</ref>


XML-RPC's idea of a human-readable-and-writable, script-parsable standard for HTTP-based requests and responses has also been implemented in competing specifications such as Allaire's [[WDDX|Web Distributed Data Exchange]] (WDDX) and webMethod's [[WIDL (Internet Standard)|Web Interface Definition Language]] (WIDL).<ref>{{Cite news|last=Udell |first=Jon |title=Exploring XML-RPC: DCOM? CORBA? RMI? Why Not Just XML-RPC? |work=Byte |accessdate=2015-11-17 |date=1999-06-07 |url=http://www.byte.com/features/1999/06/0607XML_RPC5.html |deadurl=yes |archiveurl=https://web.archive.org/web/20000304171225/http://www.byte.com/features/1999/06/0607XML_RPC5.html |archivedate=4 March 2000 }}</ref> Prior art wrapping [[Component Object Model|COM]], [[Common Object Request Broker Architecture|CORBA]], and [[Java remote method invocation|Java RMI]] objects in XML syntax and transporting them via HTTP also existed in DataChannel's WebBroker technology.<ref>{{Cite news|volume=20 |issue=21 |last=Walsh |first=Jeff |title=W3C gives a nod to DataChannel's WebBroker |work=Infoworld |accessdate=2015-11-17 |date=1998-05-25 |url=http://www.infoworld.com/cgi-bin/displayArchive.pl?/98/21/i06-21.80.htm |deadurl=yes |archiveurl=https://web.archive.org/web/19990910213004/http://www.infoworld.com/cgi-bin/displayArchive.pl?/98/21/i06-21.80.htm |archivedate=10 September 1999 }}</ref><ref>{{Cite web|last1=Vizard |first1=Michael |last2=Walsh |first2=Jeff |title=DataChannel's Dave Pool talks about shaping the role of XML to suit different needs |work=Infoworld |accessdate=2015-12-08 |date=1998-06-29 |url=http://www.infoworld.com/cgi-bin/displayStory.pl?/interviews/980629pool.htm |deadurl=yes |archiveurl=https://web.archive.org/web/19990916093829/http://www.infoworld.com/cgi-bin/displayStory.pl?/interviews/980629pool.htm |archivedate=16 September 1999 }}</ref>
XML-RPC's idea of a human-readable-and-writable, script-parsable standard for HTTP-based requests and responses has also been implemented in competing specifications such as Allaire's [[WDDX|Web Distributed Data Exchange]] (WDDX) and webMethod's [[WIDL (Internet Standard)|Web Interface Definition Language]] (WIDL).<ref>{{Cite news|last=Udell |first=Jon |title=Exploring XML-RPC: DCOM? CORBA? RMI? Why Not Just XML-RPC? |work=Byte |access-date=2015-11-17 |date=1999-06-07 |url=http://www.byte.com/features/1999/06/0607XML_RPC5.html |url-status=dead |archive-url=https://web.archive.org/web/20000304171225/http://www.byte.com/features/1999/06/0607XML_RPC5.html |archive-date=4 March 2000 }}</ref> Prior art wrapping [[Component Object Model|COM]], [[Common Object Request Broker Architecture|CORBA]], and [[Java remote method invocation|Java RMI]] objects in XML syntax and transporting them via HTTP also existed in DataChannel's WebBroker technology.<ref>{{Cite news|volume=20 |issue=21 |last=Walsh |first=Jeff |title=W3C gives a nod to DataChannel's WebBroker |work=Infoworld |access-date=2015-11-17 |date=1998-05-25 |url=http://www.infoworld.com/cgi-bin/displayArchive.pl?/98/21/i06-21.80.htm |url-status=dead |archive-url=https://web.archive.org/web/19990910213004/http://www.infoworld.com/cgi-bin/displayArchive.pl?/98/21/i06-21.80.htm |archive-date=10 September 1999 }}</ref><ref>{{Cite web|last1=Vizard |first1=Michael |last2=Walsh |first2=Jeff |title=DataChannel's Dave Pool talks about shaping the role of XML to suit different needs |work=Infoworld |access-date=2015-12-08 |date=1998-06-29 |url=http://www.infoworld.com/cgi-bin/displayStory.pl?/interviews/980629pool.htm |url-status=dead |archive-url=https://web.archive.org/web/19990916093829/http://www.infoworld.com/cgi-bin/displayStory.pl?/interviews/980629pool.htm |archive-date=16 September 1999 }}</ref>


The generic use of XML for [[remote procedure call]] (RPC) was patented by [[Phillip Merrick]], Stewart Allen, and Joseph Lapp in April 2006, claiming benefit to a provisional application filed in March 1998. The patent is assigned to [[webMethods]], located in [[Fairfax, VA]].<ref name= "merrick01">{{cite web |url=http://www.google.com/patents?id=WFV4AAAAEBAJ |title=US Patent 7,028,312 |accessdate=18 September 2008 |author=Merrick|date=11 April 2006|display-authors=etal}}</ref>
The generic use of XML for [[remote procedure call]] (RPC) was patented by Phillip Merrick, Stewart Allen, and Joseph Lapp in April 2006, claiming benefit to a provisional application filed in March 1998. The patent was assigned to [[webMethods]], located in [[Fairfax, Virginia]]. The patent expired on March 23, 2019.<ref name= "merrick01">{{cite web |url=http://www.google.com/patents?id=WFV4AAAAEBAJ |archive-url=https://web.archive.org/web/20111203095836/http://www.google.com/patents?id=WFV4AAAAEBAJ |url-status=dead |archive-date=3 December 2011 |title=US Patent 7,028,312 |access-date=18 September 2008 |author=Merrick|date=11 April 2006|display-authors=etal}}</ref>


==Usage==
==Usage==
XML-RPC works by sending an 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.
In XML-RPC, a client performs an RPC by sending an HTTP request to a server that implements XML-RPC and receives the HTTP response. A call can have multiple parameters and one result. The protocol defines a few data types for the parameters and result. Some of these data types are complex, i.e. nested. For example, you can have a parameter that is an array of five integers.


The parameters/result structure and the set of data types are meant to mirror those used in common programming languages.
''Identification'' of clients for authorization purposes can be achieved using popular HTTP security methods. [[Basic access authentication]] is used for identification, [[HTTPS]] is used when identification (via certificates) and encrypted messages are needed. Both methods can be combined.


''Identification'' of clients for authorization purposes can be achieved using popular HTTP security methods. [[Basic access authentication]] can be used for identification and authentication.
In comparison to [[REST]], where ''resource representations'' (documents) are transferred, XML-RPC is designed to ''call methods''.


In comparison to RESTful protocols, where ''resource representations'' (documents) are transferred, XML-RPC is designed to ''call methods''. The practical difference is just that XML-RPC is much more structured, which means common library code can be used to implement clients and servers and there is less design and documentation work for a specific application protocol. One salient technical difference between typical RESTful protocols and XML-RPC is that many RESTful protocols use the HTTP URI for parameter information, whereas with XML-RPC, the URI just identifies the server.
XML-RPC can be argued as simpler than [[SOAP (protocol)|SOAP]] because it
* allows only one way to serialize methods, whereas SOAP defines multiple different encodings
* has a simpler security model
* does not require (nor support) the creation of [[Web Services Description Language|WSDL]] service descriptions, although [http://web.archive.org/web/20100823030235/http://code.google.com:80/p/xrdl/ XRDL] provides a simple subset of the functionality provided by WSDL


[[JSON-RPC]] is similar to XML-RPC.
[[JSON-RPC]] is similar to XML-RPC.
Line 41: Line 36:
|array
|array
|
|
<source lang="xml">
<syntaxhighlight lang="xml">
<array>
<array>
<data>
<data>
Line 49: Line 44:
</data>
</data>
</array>
</array>
</syntaxhighlight>
</source>
|[[Array data structure|Array]] of values, storing no keys
|[[Array data structure|Array]] of values, storing no keys
|-
|-
|base64
|base64
|
|
<source lang="xml">
<syntaxhighlight lang="xml">
<base64>eW91IGNhbid0IHJlYWQgdGhpcyE=</base64>
<base64>eW91IGNhbid0IHJlYWQgdGhpcyE=</base64>
</syntaxhighlight>
</source>
|[[Base64]]-encoded binary data
|[[Base64]]-encoded binary data
|-
|-
|boolean
|boolean
|
|
<source lang="xml">
<syntaxhighlight lang="xml">
<boolean>1</boolean>
<boolean>1</boolean>
</syntaxhighlight>
</source>
|[[Boolean datatype|Boolean]] logical value (0 or 1)
|[[Boolean datatype|Boolean]] logical value (0 or 1)
|-
|-
|date/time
|date/time
|
|
<source lang="xml">
<syntaxhighlight lang="xml">
<dateTime.iso8601>19980717T14:08:55</dateTime.iso8601>
<dateTime.iso8601>19980717T14:08:55Z</dateTime.iso8601>
</syntaxhighlight>
</source>
|Date and time in [[ISO 8601]] format
|Date and time in [[ISO 8601]] format
|-
|-
|double
|double
|
|
<source lang="xml">
<syntaxhighlight lang="xml">
<double>-12.53</double>
<double>-12.53</double>
</syntaxhighlight>
</source>
|[[Double precision]] floating point number
|[[Double precision]] floating point number
|-
|-
|integer
|integer
|
|
<source lang="xml">
<syntaxhighlight lang="xml">
<int>42</int>
<int>42</int>
</syntaxhighlight>
</source>
or
or
<source lang="xml">
<syntaxhighlight lang="xml">
<i4>42</i4>
<i4>42</i4>
</syntaxhighlight>
</source>
|Whole number, [[integer]]
|Whole number, [[integer]]
|-
|-
|string
|string
|
|
<source lang="xml">
<syntaxhighlight lang="xml">
<string>Hello world!</string>
<string>Hello world!</string>
</syntaxhighlight>
</source>
or
or
<source lang="xml">
<syntaxhighlight lang="xml">
Hello world!
Hello world!
</syntaxhighlight>
</source>
|String of characters. Must follow [[XML#Characters and escaping|XML encoding]].
|String of characters. Must follow [[XML#Characters and escaping|XML encoding]].
|-
|-
|struct
|struct
|
|
<source lang="xml">
<syntaxhighlight lang="xml">
<struct>
<struct>
<member>
<member>
Line 115: Line 110:
</member>
</member>
</struct>
</struct>
</syntaxhighlight>
</source>
|[[Associative array]]
|[[Associative array]]
|-
|-
|nil
|nil
|
|
<source lang="xml">
<syntaxhighlight lang="xml">
<nil/>
<nil/>
</syntaxhighlight>
</source>
|[[nullable type|Discriminated null value]]; an XML-RPC [http://web.archive.org/web/20050911054235/http://ontosys.com:80/xml-rpc/extensions.php extension]
|[[nullable type|Discriminated null value]]; an XML-RPC [https://web.archive.org/web/20050911054235/http://ontosys.com/xml-rpc/extensions.php extension]
|}
|}


==Examples==
==Examples==
An example of a typical XML-RPC request would be:
An example of a typical XML-RPC request would be:
<source lang="xml">
<syntaxhighlight lang="xml">
<?xml version="1.0"?>
<?xml version="1.0"?>
<methodCall>
<methodCall>
Line 138: Line 133:
</params>
</params>
</methodCall>
</methodCall>
</syntaxhighlight>
</source>


An example of a typical XML-RPC response would be:
An example of a typical XML-RPC response would be:
<source lang="xml">
<syntaxhighlight lang="xml">
<?xml version="1.0"?>
<?xml version="1.0"?>
<methodResponse>
<methodResponse>
Line 150: Line 145:
</params>
</params>
</methodResponse>
</methodResponse>
</syntaxhighlight>
</source>


A typical XML-RPC fault would be:
A typical XML-RPC fault would be:
<source lang="xml">
<syntaxhighlight lang="xml">
<?xml version="1.0"?>
<?xml version="1.0"?>
<methodResponse>
<methodResponse>
Line 171: Line 166:
</fault>
</fault>
</methodResponse>
</methodResponse>
</syntaxhighlight>
</source>


== Criticism ==
== Criticism ==
Line 180: Line 175:
| date = 9 September 2009
| date = 9 September 2009
| publisher = [[Stack Overflow]]
| publisher = [[Stack Overflow]]
| accessdate = 7 April 2011
| access-date = 7 April 2011
}}
}}
</ref><ref>
</ref><ref>
Line 187: Line 182:
| title = An open poll on the merits of XmlRpc versus alternatives
| title = An open poll on the merits of XmlRpc versus alternatives
| date = 22 November 2006
| date = 22 November 2006
| publisher = [http://www.intertwingly.net intertwingly.net]
| publisher = intertwingly.net
| accessdate = 7 April 2011
| access-date = 7 April 2011
}}
}}
</ref><ref>
</ref><ref>
{{cite web
{{cite web
|url=http://joncanady.com/blog/2010/01/14/if-you-have-rest-why-xml-rpc/
|url = http://joncanady.com/blog/2010/01/14/if-you-have-rest-why-xml-rpc/
|title=If you have REST, why XML-RPC?
|title = If you have REST, why XML-RPC?
|author=Jon Canady
|author = Jon Canady
|date=14 January 2010
|date = 14 January 2010
|publisher=[http://joncanady.com joncanady.com]
|publisher = joncanady.com
|accessdate=7 April 2011
|access-date = 7 April 2011
|url-status = dead
|deadurl=yes
|archiveurl=https://web.archive.org/web/20130511053512/http://joncanady.com/blog/2010/01/14/if-you-have-rest-why-xml-rpc/
|archive-url = https://web.archive.org/web/20130511053512/http://joncanady.com/blog/2010/01/14/if-you-have-rest-why-xml-rpc/
|archivedate=11 May 2013
|archive-date = 11 May 2013
}}
}}
</ref>
</ref>


== Implementations ==
==See also==


* [[Weblogs.com]]
=== Ruby ===
* [http://web.archive.org/web/20150719223443/http://ruby-doc.org:80/stdlib-2.2.2/libdoc/xmlrpc/rdoc/XMLRPC/Client.html XML-RPC Client in stdlib]
* [http://ruby-doc.org/stdlib-2.2.2/libdoc/xmlrpc/rdoc/XMLRPC/Server.html XML-RPC Server in stdlib]


* [[Pingback]]
=== Python ===
* [http://web.archive.org/web/20121028013147/http://docs.python.org:80/library/xmlrpclib.html xmlrpclib]
** Renamed [https://docs.python.org/3.1/library/xmlrpc.client.html xmlrpc.client] in Python 3.
* [http://web.archive.org/web/20100829064907/http://twistedmatrix.com:80/documents/current/web/howto/xmlrpc.html Creating XML-RPC Servers and Clients with Twisted]


=== C++ ===
* [http://libiqxmlrpc.sourceforge.net/ Libiqxmlrpc]
* [http://ulxmlrpcpp.sourceforge.net/ Ultra lightweight XML-RPC library for C++]
* [http://xmlrpc-c.sourceforge.net/ XML-RPC for C and C++]
* [http://web.archive.org/web/20080309101136/http://xmlrpcpp.sourceforge.net:80/ XmlRpc++]
* [https://sourceforge.net/projects/xmlrpcc4win/ XmlRpc C++ client for Windows]
* [http://web.archive.org/web/20130621044029/http://www.cs.fsu.edu:80/~engelen/soap.html gSOAP toolkit for C and C++ supporting XML-RPC and more]
* [http://wiedi.frubar.net/blog/2008/03/08/libmaia-xml-rpc-with-qt4/ libmaia: XML-RPC for Qt/C++]
* [http://web.archive.org/web/20120426045609/http://xmlrpcclientlib.sourceforge.net/ XML-RPC Client S60: XML-RPC for Symbian/C++]
* [http://tntnet.org/cxxtools.html Cxxtools] XML-RPC C++ Client and Server for POSIX. It's part of [[Tntnet]] project.
* [https://github.com/sgieseking/anyrpc/ AnyRPC]{{dead link|date=July 2016 |bot=InternetArchiveBot |fix-attempted=yes }} Supports multiple RPC protocols including XML-RPC

=== Objective-C / GNUstep / Cocoa ===
* [http://web.archive.org/web/20080914190507/http://www.mulle-kybernetik.com:80/software/XMLRPC/ XMLRPC Framework]

=== Erlang ===
* [http://web.archive.org/web/20070316122756/http://erlang.stacken.kth.se:80/contrib/xmlrpc-1.13.tgz 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://web.archive.org/web/20051210031514/http://www.xmlrpc.org:80/

=== Groovy ===
* [http://web.archive.org/web/20130303205347/http://groovy.codehaus.org:80/XMLRPC XML-RPC Module]

=== Java ===
* [http://web.archive.org/web/20080112091043/http://ws.apache.org:80/xmlrpc/ Apache XML-RPC]: Open source library for Java
* [http://delight.opendfki.de/ XML-RPC Delight]: Convenient serialisation/deserialisation for Apache XML-RPC using Java Annotations and Beans
* [http://web.archive.org/web/20051116090755/http://members.fortunecity.com:80/neptune42/xmlrpc/index.htm]: Secure Apache XML-RPC
* [http://xmlrpc.sourceforge.net/ Redstone XML-RPC Library]: Redstone's Open Source Library – XML-RPC implementation in Java
* [http://web.archive.org/web/20080513124500/http://kxmlrpc.sourceforge.net:80/ XML-RPC Library for Java ME]: Open source client-side library for Java ME
* [https://github.com/gturri/aXMLRPC aXMLRPC]: Open source XML-RPC client library for Java and Android
* [http://web.archive.org/web/20160617025542/https://github.com/vnesek/nmote-xr Nmote-xr]: Open source BSD style client/server library with minimal dependencies

=== JavaScript ===
* [http://web.archive.org/web/20140802144850/https://github.com/baalexander/node-xmlrpc XML-RPC for Node.js]: Open source JavaScript XML-RPC client and server for node.js
* [http://mimic-xmlrpc.sourceforge.net/ Mimic XML-RPC]: Open source JavaScript XML-RPC client cross-browser.
* [http://web.archive.org/web/20140315040007/http://gggeek.github.io:80/jsxmlrpc/ XML-RPC for Javascript]: Open source library implementing the XML-RPC and JSON-RPC protocols, written in Javascript.
* [http://web.archive.org/web/20160617175743/https://github.com/tghosgor/polymer-xmlrpc/ XML-RPC for Google Polymer]: A Google polymer component that deals with XML-RPC resources.

=== XMPP ===
* [http://web.archive.org/web/20070103160925/http://gdr.geekhood.net:80/gdrwpl/jxmlrpc.php pyJabberXMLRPC]: Python classes for XMPP
* [http://xmpp.org/extensions/xep-0009.html Jabber-RPC]: Over the [[Extensible Messaging and Presence Protocol]] protocol

=== PHP ===
* [http://web.archive.org/web/20130523181005/http://framework.zend.com/manual/1.12/en/zend.xmlrpc.html XML-RPC in Zend_Framework 1.12]: XML-RPC Server and Client in Zend_Framework 1.12
* [http://framework.zend.com/manual/2.2/en/modules/zend.xmlrpc.intro.html XML-RPC in Zend_Framework 2.2]: XML-RPC Server and Client in Zend_Framework 2
* [http://web.archive.org/web/20140223225819/http://gggeek.github.io/phpxmlrpc/ XML-RPC for PHP]: a library implementing the XML-RPC protocol, written in PHP

=== Perl ===
* [https://metacpan.org/module/RPC::XML RPC::XML]{{dead link|date=July 2016 |bot=InternetArchiveBot |fix-attempted=yes }}: A set of Perl classes for core data, message and XML handling
* [https://metacpan.org/module/Frontier::RPC2 Frontier::RPC]: Another set of Perl modules for XML-RPC client/server implementation
* [http://web.archive.org/web/20120119200050/https://metacpan.org/module/XML::Compile::RPC XML::Compile::RPC]: RPC extension to [https://metacpan.org/module/XML::Compile XML::Compile]

=== Julia ===
* [https://github.com/sjkelly/XMLRPC.jl XMLRPC.jl]{{dead link|date=July 2016 |bot=InternetArchiveBot |fix-attempted=yes }}: An XML-RPC client written in Julia

=== Other ===
* [https://code.google.com/p/json-xml-rpc/ JSON/XML-RPC Client and Server]: Abstract away the differences between JSON-RPC and XML-RPC
* [http://web.archive.org/web/20080820204417/http://www.remobjects.com/ro RemObjects SDK] Delphi and .NET package for XML-RPC, in addition to [[SOAP (protocol)|SOAP]] and others
* [http://web.archive.org/web/20051016003305/http://www.realthinclient.com RealThinClient SDK]: For Delphi/C++
* [http://xmlrpcflash.mattism.com XML-RPC for ActionScript]: For Flash ActionScript 2.0
* [http://web.archive.org/web/20150307061456/https://github.com/Webysther/as3rpclib as3-rpclib]: For Flex/Actionscript 3
* [http://xml-rpc.net XML-RPC.NET]: Open source library for .NET clients and servers
* [http://web.archive.org/web/20080211023357/http://code.google.com:80/p/xmlrpc-light/ XmlRpc-Light]: Client and server library for OCaml
* [http://common-lisp.net/project/s-xml-rpc/ S-XML-RPC]: Client and server library for Common Lisp
* [https://github.com/Raynes/clj-xmlrpc/ clj-xmlrpc]{{dead link|date=July 2016 |bot=InternetArchiveBot |fix-attempted=yes }}: XML-RPC client for Clojure
* [https://github.com/brehaut/necessary-evil/ necessary-evil]: XML-RPC Client and Ring-based Server for Clojure
* [http://www.haskell.org/haskellwiki/HaXR HaXR]: Client and server library for Haskell
* [http://www.ruby-doc.org/stdlib/libdoc/xmlrpc/rdoc/index.html Ruby XML-RPC library]: For Ruby
* [http://www.keplerproject.org/luaxmlrpc/ XML-RPC interface to Lua]{{dead link|date=July 2016 |bot=InternetArchiveBot |fix-attempted=yes }}: For [[Lua (programming language)|Lua]]
* [https://code.google.com/p/android-xmlrpc/ android-xmlrpc]: A light XML-RPC client for Google Android
* [http://sourceforge.net/projects/xmlrpctcl/ XML-RPC for Tcl]: A Tcl implementation of XML-RPC providing client and server support
* [http://earl.strain.at/space/rebXR+Users+Guide RebXR]: a full client/server XML-RPC implementation for REBOL

==See also==
*[[Ajax (programming)]]
*[[Ajax (programming)]]
*[[Software componentry#Technologies for Software Components|Component technologies]]
*[[Software componentry#Technologies for Software Components|Component technologies]]
*[[Comparison of data serialization formats]]
*[[Comparison of data serialization formats]]
*[[OPML]]
*[[OPML]]
*[[JSON-RPC]]
*[[Web service]]
*[[Web service]]
*[[gRPC]]


==References==
==References==
{{Reflist}}
{{reflist|colwidth=30em}}


==External links==
==External links==
* [http://www.xmlrpc.com/ XML-RPC Homepage]
* {{Official| 1=http://www.xmlrpc.com/ }}
* [http://groups.yahoo.com/group/xml-rpc/ Forum]
* [http://www.xml.com/pub/rg/XML_RPC_Tutorials Tutorials]
* [http://xml.coverpages.org/xml-rpc.html Technology Reports]
* [http://citeseer.ist.psu.edu/cis?q=XML+RPC&cs=1 Citations from CiteSeer]
* [http://phpxmlrpc.sourceforge.net/wsdl/schema.rnc Relax-NG schema for XML-RPC]


{{DEFAULTSORT:Xml-Rpc}}
{{DEFAULTSORT:Xml-Rpc}}

Latest revision as of 17:40, 8 June 2024

XML-RPC is a remote procedure call (RPC) protocol which uses XML to encode its calls and HTTP as a transport mechanism.[1]

History[edit]

The XML-RPC protocol was created in 1998 by Dave Winer of UserLand Software and Microsoft,[2] with Microsoft seeing the protocol as an essential part of scaling up its efforts in business-to-business e-commerce.[3] As new functionality was introduced, the standard evolved into what is now SOAP.[4]

UserLand supported XML-RPC from version 5.1 of its Frontier web content management system,[4] released in June 1998.[5]

XML-RPC's idea of a human-readable-and-writable, script-parsable standard for HTTP-based requests and responses has also been implemented in competing specifications such as Allaire's Web Distributed Data Exchange (WDDX) and webMethod's Web Interface Definition Language (WIDL).[6] Prior art wrapping COM, CORBA, and Java RMI objects in XML syntax and transporting them via HTTP also existed in DataChannel's WebBroker technology.[7][8]

The generic use of XML for remote procedure call (RPC) was patented by Phillip Merrick, Stewart Allen, and Joseph Lapp in April 2006, claiming benefit to a provisional application filed in March 1998. The patent was assigned to webMethods, located in Fairfax, Virginia. The patent expired on March 23, 2019.[9]

Usage[edit]

In XML-RPC, a client performs an RPC by sending an HTTP request to a server that implements XML-RPC and receives the HTTP response. A call can have multiple parameters and one result. The protocol defines a few data types for the parameters and result. Some of these data types are complex, i.e. nested. For example, you can have a parameter that is an array of five integers.

The parameters/result structure and the set of data types are meant to mirror those used in common programming languages.

Identification of clients for authorization purposes can be achieved using popular HTTP security methods. Basic access authentication can be used for identification and authentication.

In comparison to RESTful protocols, where resource representations (documents) are transferred, XML-RPC is designed to call methods. The practical difference is just that XML-RPC is much more structured, which means common library code can be used to implement clients and servers and there is less design and documentation work for a specific application protocol. One salient technical difference between typical RESTful protocols and XML-RPC is that many RESTful protocols use the HTTP URI for parameter information, whereas with XML-RPC, the URI just identifies the server.

JSON-RPC is similar to XML-RPC.

Data types[edit]

Common datatypes are converted into their XML equivalents with example values shown below:

Name Tag Example Description
array
<array>
  <data>
    <value><i4>1404</i4></value>
    <value><string>Something here</string></value>
    <value><i4>1</i4></value>
  </data>
</array>
Array of values, storing no keys
base64
<base64>eW91IGNhbid0IHJlYWQgdGhpcyE=</base64>
Base64-encoded binary data
boolean
<boolean>1</boolean>
Boolean logical value (0 or 1)
date/time
<dateTime.iso8601>19980717T14:08:55Z</dateTime.iso8601>
Date and time in ISO 8601 format
double
<double>-12.53</double>
Double precision floating point number
integer
<int>42</int>

or

<i4>42</i4>
Whole number, integer
string
<string>Hello world!</string>

or

Hello world!
String of characters. Must follow XML encoding.
struct
<struct>
  <member>
    <name>foo</name>
    <value><i4>1</i4></value>
  </member>
  <member>
    <name>bar</name>
    <value><i4>2</i4></value>
  </member>
</struct>
Associative array
nil
<nil/>
Discriminated null value; an XML-RPC extension

Examples[edit]

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

<?xml version="1.0"?>
<methodCall>
  <methodName>examples.getStateName</methodName>
  <params>
    <param>
        <value><i4>40</i4></value>
    </param>
  </params>
</methodCall>

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

<?xml version="1.0"?>
<methodResponse>
  <params>
    <param>
        <value><string>South Dakota</string></value>
    </param>
  </params>
</methodResponse>

A typical XML-RPC fault would be:

<?xml version="1.0"?>
<methodResponse>
  <fault>
    <value>
      <struct>
        <member>
          <name>faultCode</name>
          <value><int>4</int></value>
        </member>
        <member>
          <name>faultString</name>
          <value><string>Too many parameters.</string></value>
        </member>
      </struct>
    </value>
  </fault>
</methodResponse>

Criticism[edit]

Recent critics (from 2010 and onwards) of XML-RPC argue that RPC calls can be made with plain XML, and that XML-RPC does not 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 verbose compared to JSON.[10][11][12]

See also[edit]

References[edit]

  1. ^ Simon St. Laurent, Joe Johnston, Edd Dumbill. (June 2001) Programming Web Services with XML-RPC. O'Reilly. First Edition.
  2. ^ Box, Don (1 April 2001). "A Brief History of SOAP". O'Reilly. Retrieved 27 October 2010.
  3. ^ Rupley, Sebastian (30 June 1999). "XML's Next Step". PC Magazine. Archived from the original on 4 March 2000. Retrieved 17 November 2015.
  4. ^ a b Walsh, Jeff (10 July 1999). "Microsoft spearheads protocol push". Infoworld. Archived from the original on 14 September 1999. Retrieved 17 November 2015.
  5. ^ Walsh, Jeff (29 June 1998). "UserLand releases Frontier 5.1, drops freeware model". InfoWorld. Archived from the original on 15 September 1999. Retrieved 17 November 2015.
  6. ^ Udell, Jon (7 June 1999). "Exploring XML-RPC: DCOM? CORBA? RMI? Why Not Just XML-RPC?". Byte. Archived from the original on 4 March 2000. Retrieved 17 November 2015.
  7. ^ Walsh, Jeff (25 May 1998). "W3C gives a nod to DataChannel's WebBroker". Infoworld. Vol. 20, no. 21. Archived from the original on 10 September 1999. Retrieved 17 November 2015.
  8. ^ Vizard, Michael; Walsh, Jeff (29 June 1998). "DataChannel's Dave Pool talks about shaping the role of XML to suit different needs". Infoworld. Archived from the original on 16 September 1999. Retrieved 8 December 2015.
  9. ^ Merrick; et al. (11 April 2006). "US Patent 7,028,312". Archived from the original on 3 December 2011. Retrieved 18 September 2008.
  10. ^ "What is the benefit of XML-RPC over plain XML?". Stack Overflow. 9 September 2009. Retrieved 7 April 2011.
  11. ^ "An open poll on the merits of XmlRpc versus alternatives". intertwingly.net. 22 November 2006. Retrieved 7 April 2011.
  12. ^ Jon Canady (14 January 2010). "If you have REST, why XML-RPC?". joncanady.com. Archived from the original on 11 May 2013. Retrieved 7 April 2011.

External links[edit]