private SubscriptionStatusValidateClient GetSubscriptionStatusValidateClient() { var service = new SubscriptionStatusValidateClient(SubscriptionStatusValidateClient.EndpointConfiguration.SubscriptionStatusValidateSOAP11, _subscriptionsAddress); service.ChannelFactory.Endpoint.EndpointBehaviors.Add(new DebugOutputEndpointBehavior()); if (_isProduction) { ((BasicHttpBinding)service.ChannelFactory.Endpoint.Binding).Security.Transport.ClientCredentialType = HttpClientCredentialType.Certificate; service.ClientCredentials.ClientCertificate.SetCertificate(StoreLocation.LocalMachine, StoreName.My, X509FindType.FindBySubjectName, _clientCertificateValue); } else { ((BasicHttpBinding)service.ChannelFactory.Endpoint.Binding).Security.Mode = BasicHttpSecurityMode.Transport;//important service.ClientCredentials.ServiceCertificate.SslCertificateAuthentication = new X509ServiceCertificateAuthentication() { CertificateValidationMode = X509CertificateValidationMode.None, RevocationMode = X509RevocationMode.NoCheck }; } return(service); }
public SubscriptionStatusValidateClient(EndpointConfiguration endpointConfiguration, System.ServiceModel.EndpointAddress remoteAddress) : base(SubscriptionStatusValidateClient.GetBindingForEndpoint(endpointConfiguration), remoteAddress) { this.Endpoint.Name = endpointConfiguration.ToString(); ConfigureEndpoint(this.Endpoint, this.ClientCredentials); }
public SubscriptionStatusValidateClient(EndpointConfiguration endpointConfiguration) : base(SubscriptionStatusValidateClient.GetBindingForEndpoint(endpointConfiguration), SubscriptionStatusValidateClient.GetEndpointAddress(endpointConfiguration)) { this.Endpoint.Name = endpointConfiguration.ToString(); ConfigureEndpoint(this.Endpoint, this.ClientCredentials); }