Calling WCF hosted on a different server from Javascript
In all the walkthroughs of calling WCF from Javascript, the svc file is part开发者_如何学Python of the WebApplication that calls WCF. However, what happens if the service endpoint is hosted on a different server? Would I start running into Cross-Domain issues?
You are probably not going to be able to achieve truly "regular WCF behavior." However, its quite possible to call JSONP from WCF as all the tutorials will tell you.
Now if you just want to be able to declare the endpoint of your service in your web.config you can simple stick this in your aspx file.
var url = '<%= ConfigurationManager.ApplicationSettings['endpoint'] %>';
Then just add an endpoint to the appSettings sections of the web.config.
精彩评论