I was recently working my way through a Flex tutorial on exchanging data with a backend ( see: http://learn.adobe.com/wiki/display/Flex/Part+II.+Exchanging+Data) provided by Adobe's Flex Developer's Center. The example in Adobe's tutorial uses the Flex HTTPService to consume XML produced by ColdFusion (there is also backend code for Java, ASP.net, and PHP provided). Unfortunately, there are some mistakes in the ColdFusion backend code that prevented me from getting the example using ColdFusion on the backend to work. I posted a comment about the problem to the page and pointed readers to this blog entry.
See: /flex/flexcfhttpservice/FlexCFHttpService.html for a working example from the above tutorial. You can right click on the application and get the source code with the corrections noted below.
Corrections to the example code:
1. In file FlexCFHttpService.mxml, the HTTPService tag uses the method="post" attribute. Given how the ColdFusion code is structured, the method value should be "get" since the CF code is structured to receive the parameter values as URL variables.
2. In file XMLHttpService.cfm, there is a missing 'a' for argumentCollection=...
3. In file XMLHttpService.cfm, just before outputting the #userXML# you should add the following:
The cfcontent tag with the reset = "yes" attribute discards any output that may have leaked out to the browser. This is important since there should not be any output prior to the ?xml... tag. The type attribute of the cfcontent tag specifies that the returned content is XML.
Once I made the above changes the example worked fine with the ColdFusion backend code.
Mini-RANT! In the first part of the above example's explanation on the Adobe site, the author specifies the following under the heading "what you will learn."
Submit user-supplied parameters to PHP, Java or ASP.NET HTTPService call.
Handle returned plain text or XML data from a PHP, Java or ASP.NET HTTPService call.
Notice that ColdFusion is NOT mentioned. However if you dig through the subsequent pages for this tutorial, the ColdFusion backend code is provided. Come on Adobe, promote your own superior backend technology!