Exemple #1
0
        /// <summary>
        /// Obtiene info del proveedor de metadata
        /// </summary>
        /// <param name="providerName">Nombre del proveedor de metadata de servicios.-</param>
        /// <returns></returns>
        public Fwk.ConfigSection.MetadataProvider GetProviderInfo(string providerName)
        {
            using (Singleservice.SingleService wService = new Singleservice.SingleService())
            {
                if (_Proxy != null)
                {
                    wService.Proxy = _Proxy;
                }
                if (_Credentials != null)
                {
                    wService.Credentials = _Credentials;
                }
                wService.Url = _URL;
                Fwk.Bases.Connector.Singleservice.MetadataProvider wMetadataProviderRemoto = wService.GetProviderInfo(providerName);

                string xml = Fwk.HelperFunctions.SerializationFunctions.SerializeToXml(wMetadataProviderRemoto);

                Fwk.ConfigSection.MetadataProvider wMetadata = Fwk.ConfigSection.MetadataProvider.GetFromXml <Fwk.ConfigSection.MetadataProvider>(xml);
                wMetadata.Name               = wMetadataProviderRemoto.Name;
                wMetadata.ApplicationId      = wMetadataProviderRemoto.ApplicationId;
                wMetadata.SourceInfo         = wMetadataProviderRemoto.SourceInfo;
                wMetadata.ConfigProviderType = wMetadataProviderRemoto.ConfigProviderType;

                return(wMetadata);
            }
        }
Exemple #2
0
        /// <summary>
        /// Recupera la configuración de un servicio de negocio.
        /// </summary>
        /// <param name="pServiceName">Nombre del servicio.</param>
        /// <returns>configuración del servicio de negocio.</returns>
        /// <date>2008-04-07T00:00:00</date>
        /// <author>moviedo</author>
        public ServiceConfiguration GetServiceConfiguration(string pServiceName)
        {
            string xmlServices = null;

            using (Singleservice.SingleService wService = new Singleservice.SingleService())
            {
                if (_Proxy != null)
                {
                    wService.Proxy = _Proxy;
                }
                if (_Credentials != null)
                {
                    wService.Credentials = _Credentials;
                }
                wService.Url = _URL;
                xmlServices  = wService.GetServiceConfiguration(_ServiceMetadataProviderName, pServiceName);
            }
            try
            {
                return(ServiceConfiguration.GetServiceConfigurationFromXml(xmlServices));
            }
            catch (Exception ex)
            {
                throw ex;// .Error = ProcessConnectionsException.Process(ex, _URL);
            }
        }
Exemple #3
0
        /// <summary>
        /// Recupera la configuración de todos los servicios de negocio.
        /// </summary>
        /// <returns>Lista de configuraciones de servicios de negocio.</returns>
        /// <date>2008-04-10T00:00:00</date>
        /// <author>moviedo</author>
        public ServiceConfigurationCollection GetAllServices()
        {
            string xmlServices = null;

            using (Singleservice.SingleService wService = new Singleservice.SingleService())
            {
                if (_Proxy != null)
                {
                    wService.Proxy = _Proxy;
                }
                if (_Credentials != null && wService.Credentials == null)
                {
                    wService.Credentials = _Credentials;
                }


                wService.Url = _URL;
                xmlServices  = wService.GetServicesList(_ServiceMetadataProviderName, true);
            }

            ServiceConfigurationCollection wServiceConfigurationCollection = (ServiceConfigurationCollection)
                                                                             Fwk.HelperFunctions.SerializationFunctions.DeserializeFromXml(typeof(ServiceConfigurationCollection), xmlServices);

            return(wServiceConfigurationCollection);
        }
Exemple #4
0
 /// <summary>
 /// Elimina la configuración de un servicio de negocio.
 /// </summary>
 /// <param name="pServiceName">Nombre del servicio.</param>
 /// <date>2008-04-13T00:00:00</date>
 /// <author>moviedo</author>
 public void DeleteServiceConfiguration(string pServiceName)
 {
     using (Singleservice.SingleService wService = new Singleservice.SingleService())
     {
         if (_Proxy != null)
         {
             wService.Proxy = _Proxy;
         }
         if (_Credentials != null)
         {
             wService.Credentials = _Credentials;
         }
         wService.Url = _URL;
         wService.DeleteServiceConfiguration(_ServiceMetadataProviderName, pServiceName);
     }
 }
Exemple #5
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="pServiceName"></param>
 /// <param name="pData"></param>
 public void ExecuteService_OneWay(string pServiceName, string pData)
 {
     using (Singleservice.SingleService wService = new Singleservice.SingleService())
     {
         if (_Proxy != null)
         {
             wService.Proxy = _Proxy;
         }
         if (_Credentials != null)
         {
             wService.Credentials = _Credentials;
         }
         wService.Url = _URL;
         wService.ExecuteService_OneWay(_ServiceMetadataProviderName, pServiceName, pData);
     }
 }
Exemple #6
0
        /// <summary>
        /// Retorna uyn alista de Service Metadata providers configurados en el Web Service Dispatcher
        /// </summary>
        /// <returns></returns>
        public DispatcherInfo RetriveDispatcherInfo()
        {
            using (Singleservice.SingleService wService = new Singleservice.SingleService())
            {
                if (_Proxy != null)
                {
                    wService.Proxy = _Proxy;
                }
                if (_Credentials != null)
                {
                    wService.Credentials = _Credentials;
                }
                wService.Url = _URL;

                Fwk.Bases.Connector.Singleservice.DispatcherInfo wsDispatcherInfo = wService.RetriveDispatcherInfo();
                DispatcherInfo wDispatcherInfo = new DispatcherInfo();


                wDispatcherInfo.ServiceDispatcherConnection = wsDispatcherInfo.ServiceDispatcherConnection;
                wDispatcherInfo.MachineIp             = wsDispatcherInfo.MachineIp;
                wDispatcherInfo.ServiceDispatcherName = wsDispatcherInfo.ServiceDispatcherName;
                List <Fwk.ConfigSection.MetadataProvider> providers = new List <MetadataProvider>();
                MetadataProvider provider = null;
                foreach (var p in wsDispatcherInfo.MetadataProviders)
                {
                    provider = new MetadataProvider();
                    provider.ApplicationId      = p.ApplicationId;
                    provider.ConfigProviderType = p.ConfigProviderType;
                    //provider.DefaultCulture = p.DefaultCulture;
                    provider.Name = p.Name;
                    provider.SecurityProviderName = p.SecurityProviderName;
                    provider.SourceInfo           = p.SourceInfo;
                    wDispatcherInfo.MetadataProviders.Add(provider);
                }
                foreach (var p in wsDispatcherInfo.AppSettings)
                {
                    wDispatcherInfo.AppSettings.Add(new DictionarySetting(p.Key, p.Value));
                }
                foreach (var p in wsDispatcherInfo.CnnStringSettings)
                {
                    wDispatcherInfo.CnnStringSettings.Add(new DictionarySetting(p.Key, p.Value));
                }

                return(wDispatcherInfo);
            }
        }
Exemple #7
0
 /// <summary>
 /// Obtiene una lista de todas las aplicaciones configuradas en el origen de datos configurado por el
 /// proveedor
 /// </summary>
 /// <returns></returns>
 public List <String> GetAllApplicationsId()
 {
     using (Singleservice.SingleService wService = new Singleservice.SingleService())
     {
         if (_Proxy != null)
         {
             wService.Proxy = _Proxy;
         }
         if (_Credentials != null)
         {
             wService.Credentials = _Credentials;
         }
         wService.Url = _URL;
         string[] wArraylist = wService.GetAllApplicationsId(_ServiceMetadataProviderName);
         return(new List <string>(wArraylist));
     }
 }
Exemple #8
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="pServiceName"></param>
        /// <param name="pData"></param>
        /// <param name="callback"></param>
        public void ExecuteServiceAsynk(string pServiceName, string pData, Delegate callback)
        {
            using (Singleservice.SingleService wService = new Singleservice.SingleService())
            {
                if (_Proxy != null)
                {
                    wService.Proxy = _Proxy;
                }
                if (_Credentials != null)
                {
                    wService.Credentials = _Credentials;
                }

                wService.Url = _URL;
                wService.ExecuteServiceCompleted += new Fwk.Bases.Connector.Singleservice.ExecuteServiceCompletedEventHandler(wService_ExecuteServiceCompleted);
            }
        }
Exemple #9
0
        /// <summary>
        /// Almacena la configuración de un nuevo servicio de negocio.
        /// </summary>
        /// <param name="pServiceConfiguration">configuración del servicio de negocio.</param>
        /// <date>2008-04-13T00:00:00</date>
        /// <author>moviedo</author>
        public void AddServiceConfiguration(ServiceConfiguration pServiceConfiguration)
        {
            Fwk.Bases.Connector.Singleservice.ServiceConfiguration wServiceConfigurationProxy =
                GetServiceConfigurationProxy(pServiceConfiguration);

            using (Singleservice.SingleService wService = new Singleservice.SingleService())
            {
                if (_Proxy != null)
                {
                    wService.Proxy = _Proxy;
                }
                if (_Credentials != null)
                {
                    wService.Credentials = _Credentials;
                }
                wService.Url = _URL;
                wService.AddServiceConfiguration(_ServiceMetadataProviderName, wServiceConfigurationProxy);
            }
        }
Exemple #10
0
        /// <summary>
        /// Ejecuta un servicio de negocio.
        /// </summary>
        /// <param name="pServiceName">Nombre del servicio.</param>
        /// <param name="pData">XML con datos de entrada para la  ejecución del servicio.</param>
        /// <returns>XML con datos de salida del servicio.</returns>
        /// <date>2007-08-23T00:00:00</date>
        /// <author>moviedo</author>
        public string ExecuteService(string pServiceName, string pData)
        {
            string wResult = null;

            using (Singleservice.SingleService wService = new Singleservice.SingleService())
            {
                if (_Proxy != null)
                {
                    wService.Proxy = _Proxy;
                }
                if (_Credentials != null)
                {
                    wService.Credentials = _Credentials;
                }

                wService.Url = _URL;
                wResult      = wService.ExecuteService(_ServiceMetadataProviderName, pServiceName, pData);
            }

            return(wResult);
        }