2011-08-26 132 views
1

我有一分钟两次的wcf服务检查%programdata%/ MYAPP文件夹,并将此目录中的所有xml文件发送到SharePoint站点。但我有一些问题,与此服务(从描述事件查看器):Windows服务问题

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) 

服务工作只有当我开始从VS2010服务(项目 - >调试 - >启动新的实例)。

回答

1

“服务工作,只有当我从VS2010启动服务(项目 - >调试 - >启动新实例)”。

听起来对我来说,就像你没有真正在Visual Studio以外的任何地方托管服务。基于它正在寻找的服务端点地址,它看起来像你的意图是在IIS下托管。

您需要为服务配置虚拟目录/应用程序。

How to: Host a WCF Service in IIS

0

该错误消息说,它无法找到https://localhost:44300/DataService.svc

服务这可能是其中VS运行服务的地址。

如果您在其他地方安装了服务,例如在端口80上,客户端无法找到它,因为客户端正在端口44300上查找。