I had recently been reviewing some documentation on a web based API that was available as an XML RPC. At first I was wondering how to achieve this, but then adapted an ASP example provided into a nice neat ColdFusion implementation. For anybody else with a similar problem of invoking an XML RPC API, the code below will at least get you started and heading down the right track.
<cfscript>
serviceurl = ‘http://testurl.com;
serviceport = 99999;
serviceuser = ‘xxxxxxxx’;
servicepass = ‘????????’;
aData= ‘123456789′;strXML = “<?xml version=’1.0′ encoding=’utf-8′ ?>”;
strXML = strXML & ‘<rpc module=’test’ method=’Method Name’ version=’1.0′>”;
strXML = strXML & “<auth>”;
strXML = strXML & “<username>” & serviceuser & “</username>”;
strXML = strXML & “<password>” & servicepass & “</password>”;
strXML = strXML & “</auth>”;
strXML = strXML & “<cli datatype=’cli’>” & Trim(aData & “</cli>”;
strXML = strXML & “</rpc>”;
objHTTP = CreateObject(”com”,”Microsoft.XMLHTTP”);
objHTTP.Open(”POST”,serviceurl & ‘:’ & serviceport & ‘/’,false);
objHTTP.Send(strXml);
</cfscript>
Once you have the response from the call, you can then use XmlParse() to transform the XML response into a working XML DOM for processing and for variable assignment.

Wouldn’t using CFHTTP have been easier? I don’t see anything that would require the use of the COM object.
I quite agree that cfhttp would be easier, but I just wanted to show it is possible to interact with a Microsoft COM object as well to do the same job. Again user preference, but all requring roughly the same amount of code. It would be interesting to see any performance differences between the two. Anybody have such information?
There is one instance where the XMLHTTP component is usefull. and thats when you need to interact with a IIS webserver thats using windows authentication.
normal CFHTTP can only do basic authentication.
other than that XML RPC is way easier with CFHTTP.
Pat