开发者

Why does 'localhost' in web references cause SocketExceptions?

开发者 https://www.devze.com 2022-12-24 17:03 出处:网络
I have two .net web services deployed to the same IIS server using SSL, one that references the other.

I have two .net web services deployed to the same IIS server using SSL, one that references the other.

If I set that web reference to 'localhost', some calls fail with this exception:

System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.Net.WebException: Unable to connect to the remote server ---> System开发者_JAVA技巧.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it

If I set it to the actual machine name, it works.

Why?


I suspect you'll find that IIS is configured to listen for requests on the "real" network interface but not on the loopback adapter.

You should be able to see this with a plain browser - try going to https://localhost on the box and see what happens.


The 127.0.0.1 possibly can resolve the problem. Why? I dont know- get from the experiments.

0

精彩评论

暂无评论...
验证码 换一张
取 消