Comparison of REST Vs XML-RPC
Some background of the protocols
Rest protocol uses the HTTP GET and HTTP PUT methods to communicate with an application server. For example an API for a typical application would look like
http://example.com/users/
http://example.com/users/{user} (one for each user)
http://example.com/findUserForm
http://example.com/locations/
http://example.com/locations/{location} (one for each location)
http://example.com/findLocationForm
The client typically a webbrowser needs to construct HTTP requests and parse XML or HTML responses.
XML-RPC uses XML protocol to make Remote procedure calls to execute functions defined on objects, over the network.
An RPC application might define operations such as the following:
getUser() addUser() removeUser() updateUser() getLocation() addLocation() removeLocation() updateLocation() listUsers() listLocations() findLocation() findUser()
The client needs to construct an XML request and parse the XML response.
Comparison
REST is an HTTP based protocol. Whereas XML-RPC is XML based.
IMO, REST being an HTTP based protocol works best when the client is a browser. XML-RPC on the other hand is XML based. So no assumption is made about the client which is going to use the protocol.
When the client is a browser, more efforts need to be put in by the client to use XML-RPC than to use REST.
An advantage of REST over XML-RPC is that each object has its own URL and can easily be cached, copied, and bookmarked.
Advantage of XML-RPC is that it is client independant. Any sort of client be it a desktop application a mobile application, a mashup using information from your site can easily integrate with XML-RPC.
Overall I think REST has its advantages in the browser world. But as more and more applications are using the web as a platform and accessing it through a variety of methods other than web browsers XML-RPC has and edge over REST.
Conclusion
Web services should provide and XML based interface like XML-RPC. The could also provide a RESTful interface built on top of XML-RPC to support browser based clients.





Thank you for a simple, easy to understand, and readily usable analysis of the two techniques. I had to read 200+ articles before I found this just-plain-good explnation.
Ram Srinivasan
July 20, 2007
and i don’t know, how to make it bette. Zaid Bethanie.
Zaid Bethanie
September 19, 2007
that’s why it will never wor. Eka Kolour.
Eka Kolour
October 22, 2007
Why will it never work?
Mayuresh
October 22, 2007
Nice, informative article. Best of all, brief!
Timmy Jose
June 9, 2008
Thanks for the explanation. Cleared up some questions I had.
Arlo
November 9, 2009
The browser world?
Kevin
July 28, 2010
[…] https://md314159265.wordpress.com/2006/10/30/comparison-of-rest-vs-xml-rpc/ […]
rest vs rpc | laplace's demon
April 1, 2011
REST is not only for browsers. HTTP is a widely spread protocol also used for B2B communication.
In fact, why would a browser directly call a REST service unless the service delivers HTML, which is rather uncommon?
Benno
November 7, 2011
“But as more and more applications are using the web as a platform and accessing it through a variety of methods other than web browsers…” ???
This article is outdated.
blessedgeek
November 30, 2011
“The client typically a webbrowser needs to construct HTTP requests and parse XML or HTML responses.”
There is no need a browser to use REST api, here is the sample python code used to print the response of a request using REST api.
import requests
url2=’http://localhost:8080/api/cmdb/ci/count/all/userkey=CCA8144E-F040-4330-8B8E-84175E5876D2′
r = requests.post(url2)
print r.text
prasanna
March 20, 2013
Hmm it looks like your site ate my first comment (it was extremely long) so I guess
I’ll just sum it up what I wrote and say, I’m thoroughly enjoying your blog.
I as well am an aspiring blog blogger but I’m still new to everything. Do you have any helpful hints for newbie blog writers? I’d genuinely appreciate it.
Some Unique Hotels Worldwide
May 28, 2013
I’m not sure exactly why but this blog is loading very slow for me. Is anyone else having this issue or is it a problem on my end? I’ll check back later and see if the problem
still exists.
Ayia Napa’s five Ideal Lodges
June 27, 2013
ix business be your objec ortance functionality i downl usic articlee
Tempat Kursus web Programming bekasi
June 7, 2015