AjaxCFC Debugging Tip

Here's a tip that I wanted to share within everyone here. It may be known but I only found out about it today and wanted to share.

If you ever get the dreaded “Invalid Reply from Server” message from AjaxCFC, spark up Firefox/FireBug and call your site from your local IP. This will give you the actual message that DWR is sending back.

Put a stop point at about line 517 (or immediately after “batch.req.send(query);”) of engine.js and look for the “batch” object. In the there you'll find the “req” (XMLHttpRequest request) object which has a standard attribute called responseText. That will give you all of the details of your error but for security reasons, it only shows it via your local IP address (127.0.0.1).

Also, if you're not using FireBug for your Ajax & javascript development efforts, you're REALLY missing out. Its a FREE addon for FireFox and it truly is an amazing addon that lets you step though all of your client-side code and inspect the DOM.

Finally, be sure to get yourself a good HTTP sniffer. I recently picked up Service Capture and it works awesome. It lets me see all of the traffic come from my request which makes identifying issues with my Ajax requests MUCH easier. Its definitely worth the $40.

UPDATE: Rob Gonda pointed out that FireBug also has a built-in http sniffer and I just tested it out! And works like a charm! Thanks Rob!

Rey…