Error while running a windows service
I have created a windows service and I had installed it on my PC. When I click Start Service from Control Panel. Then I get the following error message.
What could be wrong?
Error Message in Event Viewer:
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.HttpRe开发者_开发技巧questChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)
at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
at System.ServiceModel.Dispatcher.RequestChann...</Data>
</EventData>
</Event>
Make sure the system you are running the service from can see the end point (the asmx address). I've tried the address myself and it works (I hope this is authenticated some how). I would be guessing this may be a firewall issue or connectivity issue for the server running the service (assuming you can confirm this service works from other computers).
Try to ping the dns record to confirm to can reach the endpoint and try to copy and paste the end point address into a browser (from the server having problems) and see if that works.
精彩评论