private void initClient(MagfaConfigs configs) { var binding = new BasicHttpBinding(BasicHttpSecurityMode.Transport); binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Basic; const int integerMaxValue = int.MaxValue; binding.MaxBufferSize = integerMaxValue; binding.MaxReceivedMessageSize = integerMaxValue; binding.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max; binding.AllowCookies = true; binding.ReceiveTimeout = TimeSpan.FromSeconds(10); binding.SendTimeout = TimeSpan.FromSeconds(10); binding.OpenTimeout = TimeSpan.FromSeconds(10); binding.CloseTimeout = TimeSpan.FromSeconds(10); _smsQueueClient = new SoapSmsQueuableImplementationClient(binding, new EndpointAddress("https://sms.magfa.com/services/urn:SOAPSmsQueue")); _smsQueueClient.ChannelFactory.Credentials.UserName.UserName = configs.Username; _smsQueueClient.ChannelFactory.Credentials.UserName.Password = configs.Password; _smsQueueClient.ClientCredentials.UserName.UserName = configs.Username; _smsQueueClient.ClientCredentials.UserName.Password = configs.Password; }
public SoapSmsQueuableImplementationClient() : base(SoapSmsQueuableImplementationClient.GetDefaultBinding(), SoapSmsQueuableImplementationClient.GetDefaultEndpointAddress()) { this.Endpoint.Name = EndpointConfiguration.TSOAP.ToString(); ConfigureEndpoint(this.Endpoint, this.ClientCredentials); }
private static System.ServiceModel.EndpointAddress GetDefaultEndpointAddress() { return(SoapSmsQueuableImplementationClient.GetEndpointAddress(EndpointConfiguration.TSOAP)); }
private static System.ServiceModel.Channels.Binding GetDefaultBinding() { return(SoapSmsQueuableImplementationClient.GetBindingForEndpoint(EndpointConfiguration.TSOAP)); }
public SoapSmsQueuableImplementationClient(EndpointConfiguration endpointConfiguration, System.ServiceModel.EndpointAddress remoteAddress) : base(SoapSmsQueuableImplementationClient.GetBindingForEndpoint(endpointConfiguration), remoteAddress) { this.Endpoint.Name = endpointConfiguration.ToString(); ConfigureEndpoint(this.Endpoint, this.ClientCredentials); }
public SoapSmsQueuableImplementationClient(EndpointConfiguration endpointConfiguration) : base(SoapSmsQueuableImplementationClient.GetBindingForEndpoint(endpointConfiguration), SoapSmsQueuableImplementationClient.GetEndpointAddress(endpointConfiguration)) { this.Endpoint.Name = endpointConfiguration.ToString(); ConfigureEndpoint(this.Endpoint, this.ClientCredentials); }