Slow Web Service calls to LocalHost in ASP.NET

Wed, Nov 5, 2008

Tech Tips

Here’s a few troubleshooting steps you can use to resolve slow calls to web services that are on your local host.

1. When I googled this issue, I found this link. It reveals a setting you can make in your web.config to force all calls to local web services to bypass your proxy (if you have one). While I did have an internet proxy server, my local calls were not using it. You can validate this by first checking that your web service instance is using a proxy and your .asmx address is set to bypass the proxy (using WebProxy.IsBypassed).

2. What ended up being my problem is that I had Windows Authentication set on my web service virtual directory. This isn’t the default but it got set at some point. The problem was that the first call to the web service got an access denied error (401) and the second call would go through fine (I assume by trying default credentials). So the delay was in the 401 error. One error isn’t really noticeable, but string together 5 or 10 calls on one page and the delay is unbearable. For reference, the log files revealed the 401 errors and the multiple calls.

If you want to go a step further (and you are bored), you can troubleshoot the 401 errors in your iis log files.

Hope this helps.

Bookmark and Share
, , ,

Comments are closed.