引用web sevice之后,debug模式时正常的,但是部署在Task Schedule中报错 EndpointNotFoundException
1引用web service 报错:
Error: Exception: EndpointNotFoundException
Message: There was no endpoint listening at http://测试service地址//Service.svc that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for
more details.
Source: mscorlib
StackTrace:
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.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)
2.debug模式下时可以正常引用的,部署在Task Scheduler中就不可以,web servic 和 部署的Task Scheduler在同一个server上,windows server 2012 R2
3.将Task Scheduler部署在另外一台(不和web service在同一台server上)也是可以正常运行的。