Example #1
0
        public ValidacaoAcessoSoapClient SetConfigValidacaoAcessoService()
        {
            ValidacaoAcessoSoapClient client = new ValidacaoAcessoSoapClient();

            if (String.IsNullOrEmpty(SettingsServer.Default.AccessedUrl))
            {
                string url = GetUrlConnected("ValidacaoAcesso.asmx");

                if (url == null)
                {
                    return(null);
                }

                SettingsServer.Default.AccessedUrl = url;
                SettingsServer.Default.Save();
            }
            else
            {
                if (!VerifyInternet.VerifyConnection(SettingsServer.Default.AccessedUrl))
                {
                    return(null);
                }
            }

            client.Endpoint.Address = new EndpointAddress(SettingsServer.Default.AccessedUrl);
            return(client);
        }
Example #2
0
        public RegistroUsuarioSoapClient SetConfigRegistroUsuarioService()
        {
            RegistroUsuarioSoapClient client = new RegistroUsuarioSoapClient();

            string url = GetUrlConnected("RegistroUsuario.asmx");

            if (url == null)
            {
                return(null);
            }
            if (!VerifyInternet.VerifyConnection(url))
            {
                return(null);
            }

            client.Endpoint.Address = new EndpointAddress(url);
            return(client);
        }
Example #3
0
        public UpgradeVersionSoapClient SetUpgradeVersionService()
        {
            UpgradeVersionSoapClient client = new UpgradeVersionSoapClient();

            string url = GetUrlConnected("UpgradeVersion.asmx");

            if (url == null)
            {
                return(null);
            }
            if (!VerifyInternet.VerifyConnection(url))
            {
                return(null);
            }

            client.Endpoint.Address = new EndpointAddress(url);
            return(client);
        }
Example #4
0
        /// <summary>
        /// Verificação de qual servidor está ok para busca de dados
        /// </summary>
        /// <param name="page"></param>
        /// <returns></returns>
        public string GetUrlConnected(string page)
        {
            string url = "http://" + SettingsServer.Default.Server1_Ip + ":" + SettingsServer.Default.Server1_Port + "/" + NameServer + "/" + page;

            if (VerifyInternet.VerifyConnection(url))
            {
                return(url);
            }

            url = "http://" + SettingsServer.Default.Server2_Ip + ":" + 80 + "/" + NameServer + "/" + page;

            if (VerifyInternet.VerifyConnection(url))
            {
                return(url);
            }

            url = "http://" + SettingsServer.Default.Server3_Ip + ":" + SettingsServer.Default.Server3_Port + "/" + NameServer + "/" + page;

            return(VerifyInternet.VerifyConnection(url) ? url : null);
        }