17 January 2011

I have been preparing a presentation for my local user group on Ajax. Part of my presentation will be on REST vs. SOAP based RPC calls. One of the arguments against using SOAP based web service calls is that it is too hard to make SOAP calls using the XMLHTTPRequest object. I have not found this to be the case. The trick to making SOAP calls with XMLHTTPRequest object is setting the right request headers before making the call. SOAP calls should also be made as a post rather than a get. Here is an example below;

xmlhttp.open("POST",url,true); _ // set header for valid XML document_ xmlhttp.setRequestHeader('Content-Type', 'text/xml; charset=utf-8'); _ // Set the SOAPAction header, ColdFusion will look for the SOAPAction header._ xmlhttp.setRequestHeader('SOAPAction','[http://www.fekke.com/com/Wright/getQuote](http://www.fekke.com/com/Wright/getQuote)');

I am going to be redoing portions of my main site using Ajax. Here is a preview of my Quote from Steven Wright as an Ajax app. IBM also has a javascript framework for making SOAP based web service calls.

blog comments powered by Disqus