예제 #1
0
        /// <summary>
        /// CAmbia el proveedor
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void cb_SelectedValueChanged(object sender, EventArgs e)
        {
            _SelectedProvider = ServiceMetadata.ProviderSection.GetProvider(cmb2.SelectedItem.ToString());

            SetProviderDest();


            try
            {
                //cargo la grilla derecha
                ucbServiceGrid2.Services     = ServiceMetadata.GetAllServices(_SelectedProvider.Name);
                ucbServiceGrid2.Applications = ServiceMetadata.GetAllApplicationsId(_SelectedProvider.Name);



                //muestro el titulo
                this.Text = string.Concat("Export data from ", _SelectedProvider.Name, " to ", _SelectedProvider.Name);
            }
            catch (Exception ex)
            {
                base.ExceptionViewer.Show(ex);

                ucbServiceGrid1.Services = null;
            }
        }
예제 #2
0
        void LoadConfig()
        {
            SetProviderSource();
            SetProviderDest();


            //cargo la grilla izquierda
            ucbServiceGrid1.Services     = ServiceMetadata.GetAllServices(_SourceProvider.Name);
            ucbServiceGrid1.Applications = ServiceMetadata.GetAllApplicationsId(_SourceProvider.Name);

            //lleno el combo de posibles proveedores destino
            foreach (ServiceProviderElement p in ServiceMetadata.ProviderSection.Providers)
            {
                if (!_SourceProvider.Name.Equals(p.Name))
                {
                    cmb2.Items.Add(p.Name);
                }
            }


            cmb2.SelectedIndex = 0;
            _SelectedProvider  = ServiceMetadata.ProviderSection.GetProvider(cmb2.SelectedItem.ToString());

            cmb2.SelectedValueChanged += new EventHandler(cb_SelectedValueChanged);


            this.Text = string.Concat("Export data from ", _SourceProvider.Name, " to ", _SourceProvider.Name);
        }
예제 #3
0
        private void connectToolStripMenuItem_Click(object sender, EventArgs e)
        {
            try
            {
                ucbServiceGrid1.Services = ServiceMetadata.GetAllServices(frmServices.CurrentProvider.Name);

                ucbServiceGrid1.Applications = ServiceMetadata.GetAllApplicationsId(CurrentProvider.Name);
                provider1.SetConnected(true);
            }
            catch (Exception ex)
            {
                base.ExceptionViewer.Show(ex);
                provider1.SetConnected(false);
            }
        }
예제 #4
0
        public void ImportToDB()
        {
            String strErrorResut = String.Empty;

            try
            {
                ServiceConfigurationCollection services = ServiceMetadata.GetAllServices("XML_test");

                if (ServiceMetadata.GetAllServices("Sql_test").Count == 0)
                {
                    foreach (ServiceConfiguration s in services)
                    {
                        ServiceMetadata.AddServiceConfiguration("Sql_test", s);
                    }
                }
            }
            catch (Exception e)
            {
                strErrorResut = Fwk.Exceptions.ExceptionHelper.GetAllMessageException(e);
            }

            Assert.AreEqual <String>(strErrorResut, string.Empty, strErrorResut);
        }
예제 #5
0
        public void ServiceMetadata_Test(string providerName)
        {
            String strErrorResut = String.Empty;
            ServiceConfiguration wServiceConfigurationOriginal;
            ServiceConfiguration wServiceConfiguration;

            try
            {
                ServiceConfigurationCollection services = ServiceMetadata.GetAllServices(providerName);


                if (services.Count == 0)
                {
                    Assert.Inconclusive("No existen servicios para realizar pruevas ");
                }

                #region update
                wServiceConfigurationOriginal = ServiceMetadata.GetServiceConfiguration(providerName, services[0].Name);
                wServiceConfiguration         = wServiceConfigurationOriginal.Clone();

                wServiceConfiguration.Audit       = true;
                wServiceConfiguration.Name        = wServiceConfigurationOriginal.Name + "_test";
                wServiceConfiguration.Description = wServiceConfigurationOriginal.Description + "_test";
                wServiceConfiguration.Request     = wServiceConfigurationOriginal.Request + "_test";
                wServiceConfiguration.Response    = wServiceConfigurationOriginal.Response + "_test";
                ServiceMetadata.SetServiceConfiguration(providerName, wServiceConfigurationOriginal.Name, wServiceConfiguration);
                #endregion

                #region CHEK update
                wServiceConfiguration = null;
                wServiceConfiguration = ServiceMetadata.GetServiceConfiguration(providerName, wServiceConfigurationOriginal.Name + "_test");

                if (!wServiceConfiguration.Name.Equals(string.Concat(wServiceConfigurationOriginal.Name, "_test")) ||
                    !wServiceConfiguration.Response.Equals(string.Concat(wServiceConfigurationOriginal.Response, "_test")) ||
                    !wServiceConfiguration.Request.Equals(string.Concat(wServiceConfigurationOriginal.Request, "_test")) ||
                    !wServiceConfiguration.Description.Equals(string.Concat(wServiceConfigurationOriginal.Description, "_test")))
                {
                    Assert.Fail("La actualizacion en el metodo SetServiceConfiguration no se realizo con exito.-");
                }
                #endregion

                #region Add new service
                wServiceConfiguration = new ServiceConfiguration();

                wServiceConfiguration.Audit       = true;
                wServiceConfiguration.Description = "desc_test";
                wServiceConfiguration.Name        = "Name_test";
                wServiceConfiguration.Handler     = "Handler_test";
                wServiceConfiguration.Request     = "Request_test";
                wServiceConfiguration.Response    = "Response_test";

                ServiceMetadata.AddServiceConfiguration(providerName, wServiceConfiguration);
                #endregion

                #region CHEK  Add new service
                wServiceConfiguration = null;

                wServiceConfiguration = ServiceMetadata.GetServiceConfiguration(providerName, "Name_test");

                if (wServiceConfiguration == null)
                {
                    Assert.Fail("La creacion del servicio por medio  del metodo AddServiceConfiguration no se realizo con exito.-");
                }


                #endregion



                ServiceMetadata.DeleteServiceConfiguration(providerName, "Name_test");
                try
                {
                    wServiceConfiguration = ServiceMetadata.GetServiceConfiguration(providerName, "Name_test");
                }
                catch (Exceptions.TechnicalException te)
                {
                    if (te.ErrorId.Equals("7002"))
                    {
                    }
                }
            }
            catch (Exception e)
            {
                strErrorResut = Fwk.Exceptions.ExceptionHelper.GetAllMessageException(e);
            }

            Assert.AreEqual <String>(strErrorResut, string.Empty, strErrorResut);
        }
예제 #6
0
 /// <summary>
 /// Obtiene todos los servicios configurados
 /// </summary>
 /// <param name="providerName">Nombre del proveedor de la metadata de servicio</param>
 /// <returns>ServiceConfigurationCollection</returns>
 public static ServiceConfigurationCollection GetAllServices(string providerName)
 {
     return(ServiceMetadata.GetAllServices(providerName));
 }