http://dynamics-ax-dev.blogspot.com/2010/05/enterprise-portal-adding-ax-web-control.html
In our case the proxies were missing. This can be verified by going to AOT under static files a file with name Proxies is present. We need to make sure that all the entries are present here which are required by the web controls.