Example #1
0
        public InfoServiceProxy(string endpointConfiguration, string remoteAddress, ServiceCredentials credentials)
            : this(endpointConfiguration, remoteAddress)
        {
            if (credentials == null)
                throw new ArgumentNullException("credentials");

            credentials.ApplyTo(_channelFactory);
        }
Example #2
0
        public SwisProxyBase(Uri address, Binding binding, ServiceCredentials credentials)
        {
            if (address == null)
            {
                throw new ArgumentNullException(nameof(address));
            }

            Initialize(new EndpointAddress(address), binding, credentials);
        }
        public InformationServiceConnection(string endpointName, ServiceCredentials credentials)
        {
            if (endpointName == null)
                throw new ArgumentNullException("endpointName");
            if (credentials == null)
                throw new ArgumentNullException("credentials");

            Initialize(endpointName, null, credentials);
        }
        public InfoServiceProxy(Uri address, Binding binding, ServiceCredentials credentials)
        {
            if (address == null)
            {
                throw new ArgumentNullException("address");
            }

            Initialize(new EndpointAddress(address), binding, credentials);
        }
Example #5
0
        public InfoServiceProxy(string endpointConfiguration, ServiceCredentials credentials)
            : this(endpointConfiguration)
        {
            if (credentials == null)
            {
                throw new ArgumentNullException(nameof(credentials));
            }

            credentials.ApplyTo(ChannelFactory);
        }
Example #6
0
        public SwisProxyBase(string endpointConfiguration, ServiceCredentials credentials)
            : this(endpointConfiguration)
        {
            if (credentials == null)
            {
                throw new ArgumentNullException("credentials");
            }

            credentials.ApplyTo(_channelFactory);
        }
        public InfoServiceProxy(string endpointConfiguration, string remoteAddress, ServiceCredentials credentials)
            : this(endpointConfiguration, remoteAddress)
        {
            if (credentials == null)
            {
                throw new ArgumentNullException("credentials");
            }

            credentials.ApplyTo(_channelFactory);
        }
Example #8
0
        public InfoServiceProxy(Uri address, Binding binding, ServiceCredentials credentials)
        {
            if (address == null)
            {
                throw new ArgumentNullException(nameof(address));
            }

            var endpoint = new EndpointAddress(address, new DnsEndpointIdentity("SolarWinds-Orion"));

            Initialize(endpoint, binding, credentials);
            ChannelFactory.Endpoint.Address = endpoint; // for some reason this gets lost and needs to be set again after creation
        }
Example #9
0
        public InformationServiceContext(string endpointName, ServiceCredentials credentials)
        {
            if (endpointName == null)
            {
                throw new ArgumentNullException("endpointName");
            }
            if (endpointName.Length == 0)
            {
                throw new ArgumentException("endpoint name is empty", "endpointName");
            }
            if (credentials == null)
            {
                throw new ArgumentNullException("credentials");
            }

            this.proxy = new InfoServiceProxy(endpointName, credentials);
            this.proxy.Open();
        }
        private void Initialize(EndpointAddress address, Binding binding, ServiceCredentials credentials)
        {
            if (address == null)
            {
                throw new ArgumentNullException("address");
            }

            if (credentials == null)
            {
                throw new ArgumentNullException("credentials");
            }

            if (binding == null)
            {
                throw new ArgumentNullException("binding");
            }


            BindingElementCollection        elements = binding.CreateBindingElements();
            SslStreamSecurityBindingElement element  = elements.Find <SslStreamSecurityBindingElement>();

            if (element != null)
            {
                element.IdentityVerifier = new SWIdentityVerifier();

                CustomBinding newbinding = new CustomBinding(elements);

                // Transfer timeout settings from the old binding to the new
                newbinding.CloseTimeout   = binding.CloseTimeout;
                newbinding.OpenTimeout    = binding.OpenTimeout;
                newbinding.ReceiveTimeout = binding.ReceiveTimeout;
                newbinding.SendTimeout    = binding.SendTimeout;
                binding = newbinding;
            }

            _channelFactory = CreateChannelFactory(binding, address);
            credentials.ApplyTo(_channelFactory);

            CorrectChannelFactory();
        }
        public InformationServiceContext(string endpointName, string remoteAddress, ServiceCredentials credentials)
        {
            if (endpointName == null)
            {
                throw new ArgumentNullException(nameof(endpointName));
            }
            if (endpointName.Length == 0)
            {
                throw new ArgumentException("endpoint name is empty", nameof(endpointName));
            }
            if (remoteAddress == null)
            {
                throw new ArgumentNullException(nameof(remoteAddress));
            }
            if (credentials == null)
            {
                throw new ArgumentNullException(nameof(credentials));
            }

            Proxy = new InfoServiceProxy(endpointName, remoteAddress, credentials);
            Proxy.Open();
        }
Example #12
0
 public SwisProxyBase(EndpointAddress address, Binding binding, ServiceCredentials credentials)
 {
     Initialize(address, binding, credentials);
 }
Example #13
0
        public InfoServiceProxy(Uri address, Binding binding, ServiceCredentials credentials)
        {
            if (address == null)
                throw new ArgumentNullException("address");

            Initialize(new EndpointAddress(address), binding, credentials);
        }
 public InfoServiceProxy(EndpointAddress address, Binding binding, ServiceCredentials credentials)
 {
     Initialize(address, binding, credentials);
 }
Example #15
0
 public InfoServiceProxy(EndpointAddress address, Binding binding, ServiceCredentials credentials)
 {
     Initialize(address, binding, credentials);
 }
Example #16
0
        private void Initialize(EndpointAddress address, Binding binding, ServiceCredentials credentials)
        {
            if (address == null)
                throw new ArgumentNullException("address");

            if (credentials == null)
                throw new ArgumentNullException("credentials");

            if (binding == null)
                throw new ArgumentNullException("binding");


            BindingElementCollection elements = binding.CreateBindingElements();
            SslStreamSecurityBindingElement element = elements.Find<SslStreamSecurityBindingElement>();
            if (element != null)
            {
                element.IdentityVerifier = new SWIdentityVerifier();

                CustomBinding newbinding = new CustomBinding(elements);

                // Transfer timeout settings from the old binding to the new
                newbinding.CloseTimeout = binding.CloseTimeout;
                newbinding.OpenTimeout = binding.OpenTimeout;
                newbinding.ReceiveTimeout = binding.ReceiveTimeout;
                newbinding.SendTimeout = binding.SendTimeout;
                binding = newbinding;
            }

            _channelFactory = CreateChannelFactory(binding, address);
            credentials.ApplyTo(_channelFactory);

            CorrectChannelFactory();
        }
        private void Initialize(string endpointName, string remoteAddress, ServiceCredentials credentials)
        {
            if ((this.proxy != null) && (this.bProxyOwner != true))
                throw new InvalidOperationException("The Proxy Connection is not owned by InformationServiceConnection object");
            
            if ((this.proxy != null) && (this.proxy.Channel.State != CommunicationState.Created))
                throw new InvalidOperationException("Cannot change the endpoint for an existing connection");

            if (this.proxy != null)
                Close();

            this.endpointName = endpointName;
            this.remoteAddress = remoteAddress;
            this.credentials = credentials;

            CreateProxy();
        }