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) 
4

1 回答 1

0

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

不起作用:

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

是否有效:

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

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

于 2020-04-22T17:29:23.113 回答