我有一个窗口服务,该窗口服务使用basichttpbinding消耗了wcf服务,部署在暂存环境中时,我们不断收到此错误。这是堆栈跟踪
There was no endpoint listening at http://stgenv.com/Notification/NotificationService.svc that could
accept the message. This is often caused by an incorrect address or SOAP
action. See InnerException, if present, for more details.
Stack Trace:
Server stack trace:
at System.ServiceModel.Channels.HttpChannelUtilities.ProcessGetResponseWebException(WebException webException, HttpWebRequest request, HttpAbortReason abortReason)
at System.ServiceModel.Channels.HttpChannelFactory`1.HttpRequestChannel.HttpChannelRequest.WaitForReply(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)
at Notifications.Transport.INotificationService.GetNotificationsList()
at Vuepoint.Services.Notifications.SendService.Job.Process(Object state)
奇怪的是,它在我们的本地计算机上不可复制,并且当我们重新启动窗口服务使用者时,它似乎已经修复了自己。
我们还在日志中注意到了这一点
The HTTP service located at http://stgenv.com/Notification/NotificationService.svc is unavailable. This could be because the service is too busy or because no endpoint was found listening at the specified address. Please ensure that the address is correct and try accessing the service again later.
Stack Trace:
Server stack trace:
at System.ServiceModel.Channels.HttpChannelUtilities.ProcessGetResponseWebException(WebException webException, HttpWebRequest request, HttpAbortReason abortReason)
at System.ServiceModel.Channels.HttpChannelFactory`1.HttpRequestChannel.HttpChannelRequest.WaitForReply(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)
at Notifications.Transport.INotificationService.GetNotificationsList()
at Notifications.SendService.Job.Process(Object state)
以下是绑定细节,我们已经将其设置为最大缓冲区大小
private static BasicHttpBinding GetBinding()
{
var result = new BasicHttpBinding();
result.MaxBufferSize = 2147483647;
result.MaxReceivedMessageSize = 2147483647;
result.ReceiveTimeout = TimeSpan.FromMinutes(10);
result.SendTimeout = TimeSpan.FromMinutes(10);
System.Xml.XmlDictionaryReaderQuotas quotas = new System.Xml.XmlDictionaryReaderQuotas();
quotas.MaxStringContentLength = 2147483647;
result.ReaderQuotas = quotas;
return result;
}