【问题标题】:What are the possible cause for EndpointNotFoundException?EndpointNotFoundException 的可能原因是什么?
【发布时间】:2013-02-16 08:33:33
【问题描述】:

我正在尝试查找以下 EndpointNotFoundException 异常的潜在原因(发生在客户端,该异常是间歇性的)。异常消息描述了两种可能的原因:

  • 没有端点监听。
  • 不正确的 SOAP 操作。

我验证了两者,并且端点和 SOAP 操作都可用。网络配置似乎是正确的,所有机器都已启动、运行且负载非常轻。我还检查了诸如代理(没有)、并发(maxConcurrentConnection 增加)和性能计数器(一切看起来都很正常)之类的东西。这可能是由于客户端库中的错误(我们正在池化代理)导致代理处于故障状态或某些套接字从未关闭吗?

简而言之,我想知道什么可能会导致客户端代理中间歇性地出现该异常。

Exception: System.ServiceModel.EndpointNotFoundException: There was no endpoint listening at https://production.com/MyService.svc that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details. ---> System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: 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 11.11.111.11: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, Exception& exception) 
--- End of inner exception stack trace --- 
at System.Net.HttpWebRequest.GetRequestStream(TransportContext& context) 
at System.Net.HttpWebRequest.GetRequestStream() 
at System.ServiceModel.Channels.HttpOutput.WebRequestHttpOutput.GetOutputStream() 
--- End of inner exception stack trace --- 

Server stack trace: 
at System.ServiceModel.Channels.HttpOutput.WebRequestHttpOutput.GetOutputStream() 
at System.ServiceModel.Channels.HttpOutput.Send(TimeSpan timeout) 
at System.ServiceModel.Channels.HttpChannelFactory`1.HttpRequestChannel.HttpChannelRequest.SendRequest(Message message, TimeSpan timeout) 
at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout) 
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout) 
at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation) 
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message) 

Exception rethrown at [0]: 
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) 
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) 

【问题讨论】:

  • 我建议生成 WCF 跟踪。这通常比有关问题的异常提供更详细的信息。
  • 这是发生在客户端的异常,而不是服务器端。
  • 您可以在任一侧创建跟踪。
  • 我也遇到了同样的间歇性问题,你知道发生了什么吗?

标签: .net wcf wcf-4


【解决方案1】:

我遇到了完全相同的问题。在我的情况下,用 IP 替换计算机名称是可行的。我知道这没有多大意义。

不起作用:

<endpoint address="http://MyComputerName:82/MyApplication/MyPath/MyWebService.asmx"

有效:

<endpoint address="http://172.XX.X.X:82/MyApplication/MyPath/MyWebService.asmx"

我应该补充一点,浏览器可以使用计算机名称完全访问端点。但是,当应用程序进行调用时,它根本不起作用。

【讨论】:

    猜你喜欢
    • 2021-09-01
    • 2012-01-01
    • 2020-09-09
    • 2023-03-29
    • 2010-12-03
    • 2013-06-25
    • 1970-01-01
    • 1970-01-01
    • 2021-11-01
    相关资源
    最近更新 更多