Warning: include_once(/home/tabrez/www/talk/mtrefsearch.php) [function.include-once]: failed to open stream: No such file or directory in /home/tabrezsyed/mandalivia.com/talk/archives/000135.php on line 118
Warning: include_once() [function.include]: Failed opening '/home/tabrez/www/talk/mtrefsearch.php' for inclusion (include_path='.:/usr/local/lib/php:/usr/local/php5/lib/pear') in /home/tabrezsyed/mandalivia.com/talk/archives/000135.php on line 118
May 21, 2002
ReST vs SOAP
There is much talk about ReST (Representational State Transfer) and SOAP (Simple Object Access Protocol).
Why do you use SOAP? Say you want to use Google's search apis to get a cached page. Your SOAP query would include half a dozen SOAP envelope lines and finally explicitly mention every single parameter you are passing in. Your response will be an XML doc (enconsed in a SOAP envelope).
What does ReST say? ReST says rather than wrap all that data within a SOAP envelope just call www.google.com/xml?q=searchstring. The results will be returned as XML and you have your answer. Dont bother building all this SOAP stuff around the messages.
Why would you want all this extraneous information? well for one to deal with types and specific data. For example I believe there is a SOAP standard to allow dynamic lookup of interfaces (via UDDI and WSDL I am assuming). The reasoning that resonates with me is compatability of interfaces. For example if I were to publish a translation api that took a search parameter and I changed that parameter tomorrow I believe SOAP provides me more flexibility. I can take the XML gunk that SOAP gives me apply an XSLT transform and get the new version that allows me to service old and new customers.
xml.com has an article about google SOAP apis.
Amazon decided to go the Rest route (kinda). They have a regular old GET string that returns an xml doc. No requirements for a heavy duty SOAP client. Just fetch the URL and parse the XML and you have your data. Apparently google used to expose this via the /xml path. EBay also uses ReST.
Posted at May 21, 2002 09:22 PM