Webservice SocketException - 仅在一个应用程序上中断

时间:2009-09-18 00:07:59

标签: c# asp.net web-services exception

我有一些应用程序使用单个Web服务,它与应用程序位于同一服务器上。

为什么只有一个应用程序遇到问题连接到Web服务?并且有没有一种方法可以更好地诊断连接的问题

它甚至不会连接到应用程序本身正在托管的Web服务

我已经尝试从我的本地计算机上运行它并且工作正常(更新了web引用URL和连接字符串以指向肝脏服务器),这应该排除代码本身就是问题。

我尝试过设置不同的虚拟目录来指向应用程序;然后将entrie应用程序复制到同一服务器上的另一个位置并在那里进行设置。没有运气。

[SocketException (0x274c): A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond xx.xx.xx.xx:80]
   System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) +239
   System.Net.Sockets.Socket.InternalConnect(EndPoint remoteEP) +35
   System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception) +224

[WebException: Unable to connect to the remote server]
   System.Net.HttpWebRequest.GetRequestStream() +5321194
   System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) +103
...

1 个答案:

答案 0 :(得分:1)

找到它...代理是问题的原因,它是唯一一个我指定代理与默认代码不同的应用程序:

由于我只需要本地代理,因此我在实时web.config上使用enabled =“false”

禁用了它
  <defaultProxy enabled="false">
    <proxy
      autoDetect="False"
      bypassonlocal="True"
      scriptLocation="http://www.proxy.something"
      proxyaddress="http://proxy.com" />
  </defaultProxy>