【发布时间】:2020-08-07 12:23:48
【问题描述】:
我们有一个旧的 WCF 服务,可以很好地与现有的 MVC 应用程序配合使用。
我们最近将大部分 MVC 应用程序复制到一个新的 .Net Core 3 应用程序中。
但是,使用 WCF 服务会在 .Net Core 应用程序中出现以下错误:
“service.InnerChannel”引发了“System.ServiceModel.CommunicationObjectFaultedException”类型的异常
我在本地运行服务并在本地运行两个客户端应用程序。
控制器
wcfClient wcfService = getService();
帮手
public wcfClient getService()
{
wcfClient service = new wcfClient ();
string userName = AppSettings.wcfServicesClientUsername;
string password = AppSettings.wcfServicesClientPassword;
string passPhrase = AppSettings.wcfServicesClientPassPhrase;
userName = ServiceHelper.Encrypt(userName, passPhrase);
password = ServiceHelper.Encrypt(password, passPhrase);
return service;
}
对服务的引用:
public wcfClient() :
base(wcfClient.GetDefaultBinding(), wcfClient.GetDefaultEndpointAddress())
{
this.Endpoint.Name = EndpointConfiguration.BasicHttpBinding_IwcfClient.ToString();
ConfigureEndpoint(this.Endpoint, this.ClientCredentials);
}
我不熟悉 .Net Core,但为了使用服务,我右键单击服务连接 > 添加服务引用。
非常感谢任何帮助
【问题讨论】:
-
您好,问题解决了吗?如果问题仍然存在,请随时告诉我。
标签: c# wcf asp.net-core