gpt4 book ai didi

c# - 调用 WCF 的 C# 控制台应用程序的窗口调度程序失败

转载 作者:太空宇宙 更新时间:2023-11-03 15:45:48 25 4
gpt4 key购买 nike

我有一个从远程 WCF 服务获取数据的 C# 控制台应用程序。该应用程序在 Visual Studio 中运行良好,就像我只需双击 C# Release Bin 文件夹中的 application.exe 文件一样。两种情况都运行良好。

但是,当我尝试通过 Windows 调度程序安排运行时出现此错误

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()

知道为什么双击控制台 application.exe 可以正常工作,但不能使用 Windows 调度程序运行它。当我通过 Windows 调度程序运行时,该错误表明它无法解析服务地址。

完整的堆栈跟踪:

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)

最佳答案

这是一个 Intranet 防火墙问题。

关于c# - 调用 WCF 的 C# 控制台应用程序的窗口调度程序失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28204540/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com