So how come ColdFusion 10 fails, well it is quite weird. First I will show you an example of how our calls where structured.
First our test CFC (ajax.cfc) we will use an example.
As you can see it is quite simple. We have a function called TestCall which requires an argument called name and then returns a struct with the name value back in it. Real simple just for this simple test.
Now below is an example of how our calls were structured.
As you can see we saved our CFC's url into a global variable in case we used it more than once, then our params in an object that get passed in the simple jQuery ajax function. At success I am just dumping our response to the console log. Absolutely nothing wrong here but in ColdFusion 10 this would just hang. Below is an example with 3 different calls and the firebug output for a better visual representation.
As you can see our first call is just hanging and honestly never responds and the following 2 do work. The difference between each, is that the second request is made as a GET HTTP request and the third is a POST but with the method name in the URL portion rather than as a POST param. So to me it appeared that CF is now only looking for a method definition in the GET (URL) scope and if passed in the POST (form) scope, it just didn't know what to do. As you can see I thought I had it solved but then one thing happened by mistake. As I was writing this post I forgot to add the wsdl to the URL and everything worked.
This time everything worked. Now when I started playing with AJAX a couple of years back it was my understanding that we had to append WSDL to our CFC request but it appears it is not needed and by removing this everything worked fine in 10. So if you are experiencing this same issue do 1 of 2 things.
- Remove WSDL from your URL if you have it
- Make sure the method request is in the URL portion in a POST request
Hope this helps someone from pulling out as many hairs as I did .. good night world!