Witcher
Witcher

Reputation: 1140

Problem with windows service

I have wcf service that twice a minute check %programdata%/MYAPP folder and send all xml-files from this directory to sharepoint site. But i have some problem with this service (description from Event Viewer):

System.ServiceModel.EndpointNotFoundException: There was no endpoint listening at https://localhost:44300/DataService.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: No connection could be made because the target machine actively refused it 127.0.0.1:44300
   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, Int32 timeout, 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.HttpRequestChannel.HttpChannelRequest.SendRequest(Message message, TimeSpan timeout)
   at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
   at System.ServiceModel.Channels.SecurityChannelFactory`1.SecurityRequestChannel.Request(Message message, TimeSpan timeout)
   at System.ServiceModel.Dispatcher.RequestChannelBinder.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 IncidentReportAgent.IRS3DataService.IDataService.UploadReport(Stream reportBinary)
   at IncidentReportAgent.IncidentReportAgentService.ProcessFile(String fileName)

Service work only if i start service from VS2010 (project->debug->start new instance).

Upvotes: 1

Views: 1112

Answers (2)

Shiraz Bhaiji
Shiraz Bhaiji

Reputation: 65391

The error message says that it cannot find the service at https://localhost:44300/DataService.svc

This is probably the address where VS runs the service.

If you have installed the service anywhere else, for example on port 80, the client cannot find it because the client is looking on port 44300.

Upvotes: 0

Tim
Tim

Reputation: 28530

"Service work only if i start service from VS2010 (project->debug->start new instance)."

Sounds to me like you haven't actually hosted the service anywhere outside of Visual Studio. Based on the service endpoint address it's looking for, it looks like your intent is to host under IIS.

You'll need to configure IIS with a virtual directory/application for the service.

How to: Host a WCF Service in IIS

Upvotes: 1

Related Questions