Aug 30 2008
I've built and consumed SOAP web services. I've consumed REST web services. It wasn't until a couple days ago I got a chance to consume an XML-RPC web service. I'll readily admit, I'm still a little unsure of the exact differences between the two, but the more I Google, the clearer it is becoming.This is what I've got so far. Please correct me where I am wrong.
- REST- There is a different URL for each operation, and the query string is used to pass in all arguments. HTTP verb controls what you are doing. GET, POST, DELETE. Results often seem to be in XML, though I'm not sure that is a requirement. Must consume these manually in ColdFusion by making cfhttp requests.
- SOAP- One URL services many operations. Almost always an HTTP GET. Request and response body are an XML document describing what method to call, and the parameters. XML is pretty verbose, but handles complex parameters easily. ColdFusion makes consuming these easy-peasy pie-in-the-sky. Just point to the WSDL and and away you go. SOAPiness is all handled in the background for you. You can use cfinvoke, createobject, or cfhttp if you want to create the SOAP XML manually.
- XML-RPC- This seems to be very similar to SOAP, but simpler and older. It also uses a standard format for XML requests and responses. It handles complex arguments nicely too. No apparent support built directly into ColdFusion for creation of XML. In fact, it was very hard to get any information for XML-RPC and ColdFusion. There is an xmlrpc.cfc file out there that will create and read XML-RPC packets, but I had to wade through tons of broken links, and very old posts to find the code. Still has to be called through CFHTTP.