[英]WCF service works in MVC client but not in .Net Core 3 client
We have an old WCF service that works fine with an existing MVC application.我们有一个旧的 WCF 服务,可以与现有的 MVC 应用程序一起正常工作。
We have recently copied much of the MVC application in to a new.Net Core 3 application.我们最近将大部分 MVC 应用程序复制到了一个新的 .Net Core 3 应用程序中。
Consuming the WCF service however gives the following error with the.Net Core application:但是,使用 WCF 服务会在 .Net Core 应用程序中出现以下错误:
'service.InnerChannel' threw an exception of type 'System.ServiceModel.CommunicationObjectFaultedException' “service.InnerChannel”引发了“System.ServiceModel.CommunicationObjectFaultedException”类型的异常
I am running the service locally and both client applications locally.我在本地运行服务并在本地运行两个客户端应用程序。
Controller Controller
wcfClient wcfService = getService();
Helper帮手
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;
}
Reference to the service:服务参考:
public wcfClient() :
base(wcfClient.GetDefaultBinding(), wcfClient.GetDefaultEndpointAddress())
{
this.Endpoint.Name = EndpointConfiguration.BasicHttpBinding_IwcfClient.ToString();
ConfigureEndpoint(this.Endpoint, this.ClientCredentials);
}
I am not familiar with.Net Core but to consume the service I right clicked on Service Connections > Add Service Reference.我不熟悉.Net Core,但为了使用我右键单击服务连接>添加服务引用的服务。
Any help greatly appreciated非常感谢任何帮助
Core's support for WCF is very limited, currently only supports BasicHttpBinding, CustomBinding, NetHttpBinding, NetTcpBinding. Core对WCF的支持非常有限,目前只支持BasicHttpBinding、CustomBinding、NetHttpBinding、NetTcpBinding。 Core's support for WCF security is not particularly good.
Core 对 WCF 安全性的支持不是特别好。 Core does not have the security of the Message layer.
Core 没有 Message 层的安全性。
You need to check whether your WCF service uses features that core does not support.您需要检查您的 WCF 服务是否使用了核心不支持的功能。 Please refer to this link for core support for WCF:
有关 WCF 的核心支持,请参阅此链接:
https://github.com/dotnet/wcf/tree/master/release-notes https://github.com/dotnet/wcf/tree/master/release-notes
Feel free to let me know if the problem persists.如果问题仍然存在,请随时告诉我。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.