简体   繁体   中英

Application not calling WCF service (Both hosted on IIS7)

I have hosted a WCF Service and my ASP.Net MVC3 application in IIS7. Both are in the same server. The application is in the default app pool and the service is in a different app pool.

I've added the service reference of the hosted service to the app before publishing it. And it works locally. But when hosted on IIS7, the app is not calling services.

Any pointers on why this maybe happening and or how to debug?? Please let me know if you need any additional details.

Thanks

For future reference of anyone seeing this thread, The issue was that I was using MVC3 and ajax calls from my javascript, that looked like this:

$.ajax({
    url: 'controller/action',
    type: 'GET',
    dataType: 'json',
    success: function(data) {
}

but the url should not be 'controller/action', it should be stored in a string variable say

var callingVariable = "@Url.Action("Action","Controller")";

and this variable should be provided to the url parameter.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM