XML-RPC是一個远程过程调用(,RPC)的分布式计算協議,通过XML将调用函数封装,並使用HTTP协议作為傳送機制。
歷史
XML-RPC發表於1998年,由UserLand Software()的Dave Winer及Microsoft共同發表。後來在新的功能不斷被引入下,這個標準慢慢演變成為今日的SOAP協定。
XML-RPC協定是已登記的專利項目,由Phillip Merrick、Stewart Allen及Joseph Lapp共同持有,於1998年3月提出申請,指其將用於一個構想中的應用程式,並於2006年4月獲得接納。現時這個專利由位於美國維珍尼亞州費爾法克斯的webMethods使用。
用法
XML-RPC调用过程是由客户端通过向实现XML-RPC的服务器发送HTTP请求并接收响应实现。一次调用包含多个参数和一个结果。协议为参数和结果定义了若干数据类型。这些数据类型可以包含嵌套的,例如可以构建由五个整数组成的数组作为参数。
参数-结果结构和不同数据类型旨反映常见编程语言中使用的结构和数据类型。
可以使用流行的 HTTP 安全方法实现客户端的授权识别。基本认证可用于识别和身份验证。
JSON-RPC跟 XML-RPC 相類似。
数据类型
以下的例子為日常的数据类型在轉化為等同的XML後的面貌:
範例
以下為一個尋常的 XML-RPC 請求的範例:
examples.getStateName
40
相對於上述請求,以下為一個尋常回應的範例:
South Dakota
以下為一個尋常的 XML-RPC 錯誤:
faultCode
4
faultString
Too many parameters.
批評
实现
Python
- [https://web.archive.org/web/20100817224346/http://docs.python.org/library/xmlrpclib.html xmlrpclib]
** Renamed [http://docs.python.org/3.1/library/xmlrpc.client.html xmlrpc.client] in Python 3.
- [http://twistedmatrix.com/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://xmlrpcpp.sourceforge.net/ XmlRpc++]
- [https://sourceforge.net/projects/xmlrpcc4win/ XmlRpc C++ client for Windows]
- [http://www.cs.fsu.edu/~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++]
Objective-C / GNUstep / Cocoa
- [http://www.mulle-kybernetik.com/software/XMLRPC/ XMLRPC Framework]
- [http://divisiblebyzero.com/ Cocoa XML-RPC Framework] : Open Source XML-RPC framework written for use in Mac OS X Cocoa applications.
Erlang
- [https://web.archive.org/web/20110815192238/http://erlang.stacken.kth.se/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 https://web.archive.org/web/20051210031514/http://www.xmlrpc.org/
Java
- [http://ws.apache.org/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
- [https://web.archive.org/web/20051116090755/http://members.fortunecity.com/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://kxmlrpc.sourceforge.net/ XML-RPC Library for Java ME] : Open source client-side library for Java ME
XMPP
- [http://gdr.geekhood.net/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
Other
- [http://code.google.com/p/json-xml-rpc/ JSON/XML-RPC Client and Server] : Abstract away the differences between JSON-RPC and XML-RPC
- [http://www.remobjects.com/ro RemObjects SDK] Delphi and .NET package for XML-RPC, in addition to SOAP and others
- [http://www.realthinclient.com RealThinClient SDK] : For Delphi/C++
- [http://search.cpan.org/~daan/XML-RPC-0.5/lib/XML/RPC.pm XML::RPC] : Perl module implementation
- [http://xmlrpcflash.mattism.com XML-RPC for ActionScript] : For Flash ActionScript 2.0
- [http://code.google.com/p/as3-rpclib/ as3-rpclib] : For Flex/Actionscript 3
- [https://web.archive.org/web/20170620152017/http://xml-rpc.net/ XML-RPC.NET]: Open source library for .NET clients and servers
- [http://code.google.com/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
- [http://phpxmlrpc.sourceforge.net/ PHP-XML-RPC] : For PHP
- [https://web.archive.org/web/20100703071016/http://www.haskell.org/haxr/ HaXR]: Client and server library for Haskell
- [https://web.archive.org/web/20100823050623/http://www.x2ii.info/x2ii/xi/ xi library with PHP and Javascript XML-RPC]: For PHP and Javascript
- [https://web.archive.org/web/20101129010057/http://ruby-doc.org/stdlib/libdoc/xmlrpc/rdoc/index.html Ruby XML-RPC library]: For Ruby
- [https://web.archive.org/web/20100324022719/http://www.keplerproject.org/luaxmlrpc/ XML-RPC interface to Lua]: For Lua
- [http://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.
參看
*AJAX
*Component technologies
*List of Web service markup languages
*OPML
*Web服務
參考資料
外部連結
- [http://www.xmlrpc.com/ XML-RPC Homepage]
- [http://groups.yahoo.com/group/xml-rpc/ Forum]
- [https://web.archive.org/web/20100914031553/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]
评论 (0)