1. 添加service:
2.调用WCF
BasicHttpBinding myBinding = new BasicHttpBinding();
myBinding.Name = "BasicHttpBinding_IAuthService";
myBinding.Security.Mode = BasicHttpSecurityMode.None;
myBinding.Security.Transport.ClientCredentialType = HttpClientCredentialType.None;
myBinding.Security.Transport.ProxyCredentialType = HttpProxyCredentialType.None;
myBinding.Security.Message.ClientCredentialType = BasicHttpMessageCredentialType.UserName;
EndpointAddress endPointAddress = new EndpointAddress("http://xxxx/AuthService.svc");
AuthServiceClient client = new AuthServiceClient(myBinding, endPointAddress);
return client.CheckDateAuth(auth);
时间: 2024-10-10 02:54:22