我有一个使用WsHttpBinding绑定的WCF服务。
该服务托管在具有公共IP的服务器上。
我需要通过互联网使用此WCF服务,但出现了以下错误。
没有终结点侦听器在http://IP:9962/MyService上可以接受消息。
非常感谢您的任何帮助。
没有终结点侦听器在http://IP:9962/MyService上可以接受消息。
非常感谢您的任何帮助。
我找到了答案。 1- 我需要在使用的绑定上添加安全性。
binding.Security.Mode = SecurityMode.Message;
binding.Security.Message.ClientCredentialType = MessageCredentialType.UserName;
2- 我需要在服务主机上添加自定义身份验证。
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- 我需要在计算机的MMC中添加证书
这是一个非标准的HTTP端口,所以我的第一个问题是-防火墙/路由问题?