We have an old WCF service that works fine with an existing MVC application.
We have recently copied much of the MVC application in to a new .Net Core 3 application.
Consuming the WCF service however gives the following error with the .Net Core application:
'service.InnerChannel' threw an exception of type 'System.ServiceModel.CommunicationObjectFaultedException'
I am running the service locally and both client applications locally.
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.
Any help greatly appreciated