.net - EndpointNotFoundException 的可能原因是什么?

标签 .net wcf wcf-4

我试图找到下面 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) 
    

    最佳答案

    我有同样的问题。就我而言,用工作的 IP 替换计算机名称 .我知道这没有多大意义。

    不起作用:

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

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

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

    关于.net - EndpointNotFoundException 的可能原因是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15164550/

    相关文章:

    .net - WCF内部队列监控(为了避免向服务发送太多请求)

    .net - WCF IParameterInspector + IErrorHandler

    c# - 前台线程与后台线程

    c# - C#程序使用秒表卡住以对 Action 计时

    .net - WPF - 如何使文本垂直滚动并暂停

    c# - PerSession 与 PerCall

    .net - 即使设置为 Tls12,WCF 也会继续使用 TLS 1.0 和 RSA

    wcf - 在 WCF 服务中发布 DataAnnotation 属性,并在使用者代理类中重新生成它们?

    具有相对路径的 Asp.net 自托管 WCF 服务 WSDL

    iis - 如何使用基本身份验证将比用户名/密码更多的数据传递给 WCF 4.0 RESTful 服务中的服务方法