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;
        }
예제 #2
0
        public SoapSmsQueuableImplementationClient() :
            base(SoapSmsQueuableImplementationClient.GetDefaultBinding(), SoapSmsQueuableImplementationClient.GetDefaultEndpointAddress())
        {
            this.Endpoint.Name = EndpointConfiguration.TSOAP.ToString();

            ConfigureEndpoint(this.Endpoint, this.ClientCredentials);
        }
예제 #3
0
 private static System.ServiceModel.EndpointAddress GetDefaultEndpointAddress()
 {
     return(SoapSmsQueuableImplementationClient.GetEndpointAddress(EndpointConfiguration.TSOAP));
 }
예제 #4
0
 private static System.ServiceModel.Channels.Binding GetDefaultBinding()
 {
     return(SoapSmsQueuableImplementationClient.GetBindingForEndpoint(EndpointConfiguration.TSOAP));
 }
예제 #5
0
 public SoapSmsQueuableImplementationClient(EndpointConfiguration endpointConfiguration, System.ServiceModel.EndpointAddress remoteAddress) :
     base(SoapSmsQueuableImplementationClient.GetBindingForEndpoint(endpointConfiguration), remoteAddress)
 {
     this.Endpoint.Name = endpointConfiguration.ToString();
     ConfigureEndpoint(this.Endpoint, this.ClientCredentials);
 }
예제 #6
0
 public SoapSmsQueuableImplementationClient(EndpointConfiguration endpointConfiguration) :
     base(SoapSmsQueuableImplementationClient.GetBindingForEndpoint(endpointConfiguration), SoapSmsQueuableImplementationClient.GetEndpointAddress(endpointConfiguration))
 {
     this.Endpoint.Name = endpointConfiguration.ToString();
     ConfigureEndpoint(this.Endpoint, this.ClientCredentials);
 }