Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I make a JavaScript call to a WCF service hosted on a different domain?

We are designing a web application using ASP.NET and AJAX and we want to host our WCF Service Layer on a different website and make JavaScript calls to the Service Layer from our client pages. We understand that the browser will not allow AJAX calls to a different port or domain. What is the best way to architect a solution? We are considering using a proxy layer with services hosted on the same domain as the client which has a web reference to the service layer. Is there a better solution?


1 Answers

It's generally best to limit the number of domains accessed by your page. A server-side proxy is really a good way to go.

like image 120
keparo Avatar answered Dec 08 '25 16:12

keparo