我已经创建了一个Windows服务,我已经在我的电脑上安装了它。当我从控制面板单击启动服务时。然后我收到以下错误消息。
可能出现什么问题?
事件查看器中的错误消息:
Description:
Service cannot be started. System.ServiceModel.EndpointNotFoundException: There was no endpoint listening at http://www.domain.in/MyServ.asmx 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: The remote server returned an error: (404) Not Found.
at System.Net.HttpWebRequest.GetResponse()
at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)
--- End of inner exception stack trace ---
Server stack trace:
at System.ServiceModel.Channels.HttpChannelUtilities.ProcessGetResponseWebException(WebException webException, HttpWebRequest request, HttpAbortReason abortReason)
at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)
at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
at System.ServiceModel.Dispatcher.RequestChann...
Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
<Provider Name="Service1" />
<EventID Qualifiers="0">0</EventID>
<Level>2</Level>
<Task>0</Task>
<Keywords>0x80000000000000</Keywords>
<TimeCreated SystemTime="2011-06-04T05:21:43.000000000Z" />
<EventRecordID>38441</EventRecordID>
<Channel>Application</Channel>
<Computer>TaxSmart30</Computer>
<Security />
</System>
<EventData>
<Data>Service cannot be started. System.ServiceModel.EndpointNotFoundException: There was no endpoint listening at http://www.mydomain.com/MyServ.asmx 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: The remote server returned an error: (404) Not Found.
at System.Net.HttpWebRequest.GetResponse()
at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)
--- End of inner exception stack trace ---
Server stack trace:
at System.ServiceModel.Channels.HttpChannelUtilities.ProcessGetResponseWebException(WebException webException, HttpWebRequest request, HttpAbortReason abortReason)
at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)
at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
at System.ServiceModel.Dispatcher.RequestChann...</Data>
</EventData>
</Event>
答案 0 :(得分:1)
确保您运行服务的系统可以看到终点(asmx地址)。我自己尝试了这个地址并且它有效(我希望这是经过验证的一些方法)。我猜这可能是运行该服务的服务器的防火墙问题或连接问题(假设您可以确认此服务可以在其他计算机上运行)。
尝试ping dns记录以确认可以到达端点并尝试将终点地址复制并粘贴到浏览器中(从有问题的服务器)并查看是否有效。