Consuming a wcf service over the Internet

I have a wcf service that uses WsHttpBinding as a binding. This service is hosted on a server with a public IP address. I need to consume this wcf service over the internet, but it gives me the error below.

there was no endpoint that listened at http: // IP: 9962 / MyService that could receive the message.

Any help is greatly appreciated.

+3
source share
2 answers

I have found the answer. 1- I need to add security for the binding that I use.

binding.Security.Mode = SecurityMode.Message;
binding.Security.Message.ClientCredentialType = MessageCredentialType.UserName;

2- I need to add user authentication to the service host.

svh.Credentials.UserNameAuthentication.UserNamePasswordValidationMode = System.ServiceModel.Security.UserNamePasswordValidationMode.Custom;
People365UserNameValidator cs = new People365UserNameValidator();
svh.Credentials.UserNameAuthentication.CustomUserNamePasswordValidator = cs;
svh.Credentials.ServiceCertificate.SetCertificate(StoreLocation.LocalMachine,
StoreName.TrustedPeople, X509FindType.FindByIssuerName, "Certificate Name");

3- I need to add a certificate to the mmc of the computer

0
source

HTTP, : /?

0

All Articles