示例#1
0
        /// <summary>
        /// Elimina un seriovicio del repositorio y del origen de metadata de servicios.-
        /// </summary>
        /// <param name="providerName">Nombre del proveedor de metadata de servicios.-</param>
        /// <param name="serviceName">Nombre del servicio</param>
        public static void DeleteServiceConfiguration(string providerName, string serviceName)
        {
            ServiceProviderElement provider = GetProvider(providerName);

            ServiceConfigurationCollection svcList = GetAllServices(provider);

            if (!svcList.Exists(serviceName, provider.ApplicationId))
            {
                Exceptions.TechnicalException te = new Exceptions.TechnicalException(string.Format("El servicio {0} no se encuentra configurado.\r\nProveedor de Metadata: {1}\r\nApplicationId: {2}\r\n", serviceName, provider.Name, provider.ApplicationId));
                te.ErrorId = "7002";
                Fwk.Exceptions.ExceptionHelper.SetTechnicalException <ServiceMetadata>(te);

                throw te;
            }
            ServiceConfiguration wServiceConfigurationEnMemoria = svcList.GetServiceConfiguration(serviceName, provider.ApplicationId);

            svcList.Remove(wServiceConfigurationEnMemoria);

            if (provider.ProviderType == ServiceProviderType.xml)
            {
                XmlServiceConfigurationManager.DeleteServiceConfiguration(provider.SourceInfo, svcList);
            }
            else
            {
                DatabaseServiceConfigurationManager.DeleteServiceConfiguration(serviceName, provider.ApplicationId, provider.SourceInfo);
            }
        }
示例#2
0
        /// <summary>
        /// Crea un servicio en el origen de datos indicado por el proveedor
        /// El aaplication Id que se utiliza es el del  nuevo servicio. Si el provedor estra configurado para usar uno determinado este se ignora
        /// de esta manera un proveedor puede insertar servicios para diferentes aplicaciones
        /// </summary>
        /// <param name="providerName">Nombre del proveedor de metadata de servicios.-</param>
        /// <param name="pServiceConfiguration"><see cref="ServiceConfiguration"/></param>
        public static void AddServiceConfiguration(string providerName, ServiceConfiguration pServiceConfiguration)
        {
            ServiceProviderElement provider = GetProvider(providerName);

            ServiceConfigurationCollection svcList = GetAllServices(provider);

            if (svcList.Exists(pServiceConfiguration.Name, pServiceConfiguration.ApplicationId))
            {
                Exceptions.TechnicalException te = new Exceptions.TechnicalException(string.Format("El servicio {0} ya existe.\r\nProveedor de Metadata: {1}\r\nApplicationId: {2}\r\n", pServiceConfiguration.Name, provider.Name, provider.ApplicationId));
                te.ErrorId = "7002";
                Fwk.Exceptions.ExceptionHelper.SetTechnicalException <ServiceMetadata>(te);
                throw te;
            }



            svcList.Add(pServiceConfiguration);

            if (provider.ProviderType == ServiceProviderType.xml)
            {
                XmlServiceConfigurationManager.AddServiceConfiguration(pServiceConfiguration, provider.SourceInfo, svcList);
            }
            else
            {
                DatabaseServiceConfigurationManager.AddServiceConfiguration(pServiceConfiguration, pServiceConfiguration.ApplicationId, provider.SourceInfo);
            }
        }
示例#3
0
        /// <summary>
        /// Obtine un servicio del repositorio
        /// </summary>
        /// <param name="providerName">Nombre del proveedor de metadata de servicios.-</param>
        /// <param name="serviceName">Nombre del servicio</param>
        /// <returns></returns>
        public static ServiceConfiguration GetServiceConfiguration(string providerName, string serviceName)
        {
            ServiceConfiguration   svc      = null;
            ServiceProviderElement provider = GetProvider(providerName);

            ServiceConfigurationCollection svcList = GetAllServices(provider);

            svc = svcList.GetServiceConfiguration(serviceName, provider.ApplicationId);


            if (svc == null)
            {
                Exceptions.TechnicalException te = new Exceptions.TechnicalException(
                    string.Format("El servicio {0} no se encuentra configurado.\r\nProveedor de Metadata: {1}\r\nApplicationId: {2}\r\n", serviceName, provider.Name, provider.ApplicationId));
                te.ErrorId = "7002";
                Fwk.Exceptions.ExceptionHelper.SetTechnicalException <ServiceMetadata>(te);
                throw te;
            }

            return(svc);
        }
示例#4
0
        /// <summary>
        /// Obtine un servicio del repositorio
        /// </summary>
        /// <param name="providerName">Nombre del proveedor de metadata de servicios.-</param>
        /// <param name="serviceName">Nombre del servicio</param>
        /// <returns></returns>
        public static ServiceConfiguration GetServiceConfiguration(string providerName, string serviceName)
        {
            ServiceConfiguration svc = null;
            ServiceProviderElement provider = GetProvider(providerName);

            ServiceConfigurationCollection svcList = GetAllServices(provider);
            svc = svcList.GetServiceConfiguration(serviceName, provider.ApplicationId);


            if (svc == null)
            {
                Exceptions.TechnicalException te = new Exceptions.TechnicalException(
                    string.Format("El servicio {0} no se encuentra configurado.\r\nProveedor de Metadata: {1}\r\nApplicationId: {2}\r\n", serviceName,provider.Name, provider.ApplicationId));
                te.ErrorId = "7002";
                Fwk.Exceptions.ExceptionHelper.SetTechnicalException<ServiceMetadata>(te);
                throw te;
            }

            return svc;

        }
示例#5
0
        /// <summary>
        /// Elimina un seriovicio del repositorio y del origen de metadata de servicios.-
        /// </summary>
        /// <param name="providerName">Nombre del proveedor de metadata de servicios.-</param>
        /// <param name="serviceName">Nombre del servicio</param>
        public static void DeleteServiceConfiguration(string providerName, string serviceName)
        {

            ServiceProviderElement provider = GetProvider(providerName);

            ServiceConfigurationCollection svcList = GetAllServices(provider);
            if (!svcList.Exists(serviceName, provider.ApplicationId))
            {
                Exceptions.TechnicalException te = new Exceptions.TechnicalException(string.Format("El servicio {0} no se encuentra configurado.\r\nProveedor de Metadata: {1}\r\nApplicationId: {2}\r\n", serviceName, provider.Name, provider.ApplicationId));
                te.ErrorId = "7002";
                Fwk.Exceptions.ExceptionHelper.SetTechnicalException<ServiceMetadata>(te);

                throw te;
            }
            ServiceConfiguration wServiceConfigurationEnMemoria = svcList.GetServiceConfiguration(serviceName, provider.ApplicationId);
            svcList.Remove(wServiceConfigurationEnMemoria);

            if (provider.ProviderType == ServiceProviderType.xml)
                XmlServiceConfigurationManager.DeleteServiceConfiguration(provider.SourceInfo, svcList);
            else
                DatabaseServiceConfigurationManager.DeleteServiceConfiguration(serviceName, provider.ApplicationId, provider.SourceInfo);

        }
示例#6
0
        /// <summary>
        /// Crea un servicio en el origen de datos indicado por el proveedor
        /// El aaplication Id que se utiliza es el del  nuevo servicio. Si el provedor estra configurado para usar uno determinado este se ignora
        /// de esta manera un proveedor puede insertar servicios para diferentes aplicaciones
        /// </summary>
        /// <param name="providerName">Nombre del proveedor de metadata de servicios.-</param>
        /// <param name="pServiceConfiguration"><see cref="ServiceConfiguration"/></param>
        public static void AddServiceConfiguration(string providerName, ServiceConfiguration pServiceConfiguration)
        {
            ServiceProviderElement provider = GetProvider(providerName);

            ServiceConfigurationCollection svcList = GetAllServices(provider);

            if (svcList.Exists(pServiceConfiguration.Name, pServiceConfiguration.ApplicationId))
            {
                Exceptions.TechnicalException te = new Exceptions.TechnicalException(string.Format("El servicio {0} ya existe.\r\nProveedor de Metadata: {1}\r\nApplicationId: {2}\r\n", pServiceConfiguration.Name, provider.Name, provider.ApplicationId));
                te.ErrorId = "7002";
                Fwk.Exceptions.ExceptionHelper.SetTechnicalException<ServiceMetadata>(te);
                throw te;
            }



            svcList.Add(pServiceConfiguration);

            if (provider.ProviderType == ServiceProviderType.xml)
                XmlServiceConfigurationManager.AddServiceConfiguration(pServiceConfiguration, provider.SourceInfo, svcList);
            else
                DatabaseServiceConfigurationManager.AddServiceConfiguration(pServiceConfiguration, pServiceConfiguration.ApplicationId, provider.SourceInfo);
        }