If you use any other security mode you will receive the following error message.
Security settings for this service require 'Anonymous' Authentication but it is not enabled for the IIS application that hosts this service.
If you are receiving the following error message, make sure the website bindings are configured for https.
Could not find a base address that matches scheme https for the endpoint with binding WSHttpBinding. Registered base address schemes are [http].
<!—The system.serviceModel section can be replaced with the following -->
<!-- When using wsHttpBinding, the security mode must be “Transport” for Windows Authentication on IIS to be used. Also the website needs to have a server certificate configured. -->
‘You might receive errors relating to the server certificate when the name on the server certificate does not match the name used in the application endpoint address.
Could not establish trust relationship for the SSL/TLS secure channel with authority 'myIISServer.myDomain.com'.
Make sure you are adding the RemoteCertValidate method and declare the ServerCertificateValidationCallback delegate. C# version of the client is added below for reference.
<!—The following system.serviceModel Section can be replaced in the client’s app.config file -->