可能导致EndpointNotFoundException的原因是什么?

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) 

我建议生成一个WCF跟踪。这通常比异常提供了更详细的信息,可以看出哪里出错了。 - 500 - Internal Server Error
这是客户端发生的异常,而不是服务器端。 - Martin
你可以在任何一侧创建跟踪。 - 500 - Internal Server Error
我遇到了同样的间歇性问题,你最终解决了这是怎么回事吗? - lostatredrock
1个回答

0
我曾经遇到过完全相同的问题。在我的情况下,用IP地址替换计算机名称解决了问题。我知道这听起来有些无厘头。

不起作用:

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

能够工作:

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

我应该补充说明,使用计算机名称通过浏览器访问端点是完全可行的。然而,当应用程序发起调用时,它就无法正常工作。

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接