Bug in calling CFC's remotely via the URL when using application.cfc
I've just been playing with the incredible <cfajaxproxy> tag in CF8 and have come across what appears to be a bug in Coldfusion when using application.cfc and calling CFC's via the URL method.
The URL method allows you to call CFC's via a URL and access any method in the CFC which has access="remote" set. Coldfusion will take care of returning the data as WDDX encoded or in JSON if using Coldfusion 8.
Anyway, I was testing this earlier today and found that no matter what I did, when calling a method in a CFC using the URL method a blank page was returned. It was incredibly frustrating!
A quick trip to the excellent #coldfusion IRC channel on Dalnet gave me the answer though (thanks Hapex) - application.cfc.
Well more specifically the onRequest method in application.cfc! For some reason if this method is defined in the file, remote CFC calls will simply display a blank page.
The solution? Comment out onRequest if you aren't making use of it. If you are, simply create an application.cfm and place it in the folder with your remotely accessed CFC's.
I believe this has been submitted to Adobe as a bug.. Hopefully it'll get fixed in the next release.





if ( right(arguments.targetPage,4) is ".cfc" ) {
structDelete(this,"onRequest");
structDelete(variables,"onRequest");
}
(This is actually what Fusebox 5.5 does)
Hopefully this one will get fixed officially at some point. I believe it was also a problem in CF7.
Brilliant! Glad I could help someone with this. I know when it got me there was many an angry comment shouted at the monitor.. ;) The last thing you need when trying to get remote CFC calls working.