Question

I am using Windows Server 2008 R2 with IIS 7. My MVC application runs fine on asp.net 4.5 version. Note that application works fine on other servers and hosting accounts.

However, on one of the new system... only one of the function is not working and I'm getting an error trying to run another function from application by making an http call!

This works fine on other all other hosting accounts (on different server) / on shared server too and development machine. Not sure why on this new windows 2008 server with IIS its not working.

I am getting (404) Not Found error when application tries to call this URL.

If I call the function manually, it runs.. but I need to call this function in certain event by making an http call within application. This is a loopback connection originating from application to the same application but another function called at different url with parameters.

Can anyone advise what could be wrong here? And what thing we need to fix to enable loopback connections support in IIS / server?

Here is the code that is used.

HttpWebRequest objRequest = (HttpWebRequest)WebRequest.Create(url);
objRequest.Method = "GET";
objRequest.ContentType = "application/x-www-form-urlencoded";
objRequest.AllowAutoRedirect = true;

ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(AcceptAllCertifications);

Awaiting your quick response on the same.

Was it helpful?

Solution

The issue was with the mapping of the domain in Server. When trying to open the domain from external network, it serves the website correctly. But when I tried to open on the browser on the same server it wasn't serving the request.

I added the domain name entry to the windows hosts file and resolved it to 127.0.0.1, then it started to work fine.

Thank you everyone for your efforts in helping me fixing the issue. Without your inputs I might not be able to fix this. The credit is all yours, but as there was no answer I created an answer for helping other who faces same issue.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top