代码之家  ›  专栏  ›  技术社区  ›  CRice

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

  •  1
  • CRice  · 技术社区  · 17 年前

    我有几个应用程序使用一个Web服务,它与应用程序驻留在同一台服务器上。

    只有一个应用程序有问题 有什么方法可以更好地准确诊断连接的问题吗

    它甚至不会连接到应用程序本身承载的web服务

    我试着在本地机器上运行它,它运行得很好(更新了web引用url和连接字符串以指向liver服务器),这应该排除代码本身是问题所在。

    [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 回复  |  直到 17 年前
        1
  •  1
  •   CRice    17 年前

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

    因为我只在本地需要代理,所以在live web.config上使用enabled=“false”禁用了它

      <defaultProxy enabled="false">
        <proxy
          autoDetect="False"
          bypassonlocal="True"
          scriptLocation="http://www.proxy.something"
          proxyaddress="http://proxy.com" />
      </defaultProxy>
    
    推荐文章