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