- The server has rejected the client credentials.
- The socket connection was aborted. This could be caused by an error processing your message or a receive timeout being exceeded by the remote host, or an underlying network resource issue. Local socket timeout was '00:00:59.9687500'.
- The communication object, System.ServiceModel.ServiceHost, cannot be used for communication because it is in the Faulted state.
I have developed a WCF solution in WinForm which allows you to comment out certain settings in the server and client so that you can reproduce the above mentioned error message.
https://github.com/lauhw/WcfWinForm
Please beware that if you are running the WCF server and client in the same computer, the above error might not appear until you run them in a separate computer.
In a nutshell:
- Both server and client config file must have the same settings in the "Binding" record. This includes the "security mode".
- The "identity" settings must be the same in both server and client config file.
- In the live environment, make sure you remove the "MEX" endpoint unless you want anyone to be able to query the interface.
- Don't forget to open the port in the firewall.
Hope you don't have to spend 2 days to solve the configuration problem. ;)