0
votes

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

1
Hi, is the problem resolved? If the problem persists, please feel free to let me know.Ding Peng

1 Answers

0
votes

Core's support for WCF is very limited, currently only supports BasicHttpBinding, CustomBinding, NetHttpBinding, NetTcpBinding. Core's support for WCF security is not particularly good. Core does not have the security of the Message layer.

enter image description here

You need to check whether your WCF service uses features that core does not support. Please refer to this link for core support for WCF:

https://github.com/dotnet/wcf/tree/master/release-notes

Feel free to let me know if the problem persists.