2
votes

I have a C# Console application that get data from remote WCF service. the app runs fine in Visual studio as well as if I simply double click on the application.exe files in the C# Release Bin folder. Both cases runs fine.

However, When I try to schedule the run via Windows scheduler I get this error

The remote name could not be resolved: at System.Net.HttpWebRequest.GetRequestStream(TransportContext& context) at System.Net.HttpWebRequest.GetRequestStream() at System.ServiceModel.Channels.HttpOutput.WebRequestHttpOutput.GetOutputStream()

Any idea why double clicking the console application.exe works fine, but not running it using windows scheduler. The error says it can't resolve the service address when I run via Windows Scheduler.

Full stack trace:

System.ServiceModel.EndpointNotFoundException: There was no endpoint listening at https://abc.defg.com:444/somedata.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: The remote name could not be resolved: 'abc.defg.com' 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`1.HttpRequestChannel.HttpChannelRequest.SendRequest(Message message, 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)

1
Did you try going to the url? Does it result in an error or do you actually see something? Is the task in windows scheduler running as a different user?Styxxy
Hi ... I can go to the url from a web browser with no problem and I actually downloaded the client class class to use in my console app. The task in windows scheduler runs under my own login credentials.jscriptor
Is your service hosted in IIS?tom redfern
Hi Tom ... Thank you for the follow up. It is a third party remote service with login credentials provided. I am not sure if hosted on IIS but the ask via email. I am wondering how does this affect the task scheduler?jscriptor
Hi ... it was an intranet firewall issue.jscriptor

1 Answers

0
votes

It was an intranet firewall issue.