.Net web service call throws a 'Network Unreachable' exception - yet it is quite demonstrably reachable

≯℡__Kan透↙ 提交于 2019-12-11 18:29:49

问题


I have a remote .Net web service that I have added as a web reference to my project via its WSDL. When I try to invoke a method on it I get the following exception:

A socket operation was attempted to an unreachable network 176.31.222.123:443
   at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
   at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception)

The address it's trying to connect to is one of my own servers, and not only can I quite happily reach that IP address from my machine - other parts of the code that are also connecting to the same server work absolutely fine. It's only when using the web reference that it falls over.

Even weirder is that it doesn't happen on every machine, even between different machines on the same network give different results.

I'm almost certain something very daft is going on that will make me face palm, but does anyone have any clue about what on earth is going on?

来源:https://stackoverflow.com/questions/13782624/net-web-service-call-throws-a-network-unreachable-exception-yet-it-is-quite

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!