示例#1
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 Fwk.Bases.ServiceConfiguration GetServiceConfiguration(String pServiceName)
        {
            InitilaizeBinding();
            GetServiceConfigurationRequest  wcfReq = new GetServiceConfigurationRequest();
            GetServiceConfigurationResponse wcfRes = null;

            wcfReq.providerName = _ServiceMetadataProviderName;
            wcfReq.serviceName  = pServiceName;

            var         channelFactory = new ChannelFactory <IFwkService>(binding, address);
            IFwkService client         = null;

            try
            {
                client = channelFactory.CreateChannel();
                wcfRes = client.GetServiceConfiguration(wcfReq);
                ((ICommunicationObject)client).Close();
            }
            catch (Exception ex)
            {
                if (client != null)
                {
                    ((ICommunicationObject)client).Abort();
                }
                throw ex;
            }

            Fwk.Bases.ServiceConfiguration wServiceConfiguration = (Fwk.Bases.ServiceConfiguration)
                                                                   Fwk.HelperFunctions.SerializationFunctions.DeserializeFromXml(typeof(Fwk.Bases.ServiceConfiguration), wcfRes.GetServiceConfigurationResult);

            return(wServiceConfiguration);
        }
示例#2
0
        void Expòrt()
        {
            log = new StringBuilder();
            foreach (Fwk.Bases.ServiceConfiguration s in _Services)
            {
                try
                {
                    Fwk.Bases.ServiceConfiguration sclon = s.Clone();

                    sclon.ApplicationId = txtAppId.Text;

                    ServiceMetadata.AddServiceConfiguration(_SelectedProvider.Name, sclon);
                    log.AppendLine(string.Concat(s.Name, " OK"));
                }
                catch (Fwk.Exceptions.TechnicalException te)
                {
                    if (te.ErrorId.Equals("7002"))
                    {
                        log.AppendLine(string.Concat(s.Name, " already exist"));
                    }
                    else
                    {
                        log.AppendLine(string.Concat(s.Name, Fwk.Exceptions.ExceptionHelper.GetAllMessageException(te)));
                    }
                    _HasErrors = true;
                }
            }
            textBox1.Text = log.ToString();
        }
示例#3
0
        /// <summary>
        ///
        /// </summary>
        public void FillServiceConfiguration()
        {
            Fwk.Bases.ServiceConfiguration wServiceConfiguration = new Fwk.Bases.ServiceConfiguration();
            wServiceConfiguration = (Fwk.Bases.ServiceConfiguration)bindingSourceService.DataSource;
            wServiceConfiguration.IsolationLevel         = (Fwk.Transaction.IsolationLevel)Enum.Parse(typeof(Fwk.Transaction.IsolationLevel), cboIsolationLevel.Text);
            wServiceConfiguration.TransactionalBehaviour = (Fwk.Transaction.TransactionalBehaviour)Enum.Parse(typeof(Fwk.Transaction.TransactionalBehaviour), cboTransactionalBehaviour.Text);

            this.EntityResult = wServiceConfiguration;
        }
示例#4
0
        void LoadAssembly()
        {
            try
            {
                Assembly wAssembly = new Assembly(_StorageFactory.StorageObject.AssemblyPath);
                Fwk.Bases.ServiceConfiguration           s    = null;
                Fwk.Bases.ServiceConfigurationCollection list = new Fwk.Bases.ServiceConfigurationCollection();
                lblFileName.Text = _StorageFactory.StorageObject.AssemblyPath;

                foreach (AssemblyClass wAssemblyClass in wAssembly.ClassCollections)
                {
                    if (wAssemblyClass.BaseType != null)
                    {
                        if (wAssemblyClass.BaseType.Name.Contains("BusinessService"))
                        {
                            if (!Services.Exists(p => p.Name.Equals(wAssemblyClass.Name.Trim())))
                            {
                                s = new Fwk.Bases.ServiceConfiguration();
                                //Service name
                                s.Name    = wAssemblyClass.Name;
                                s.Handler = wAssemblyClass.FullyQualifiedName;
                                //Request
                                s.Request = wAssemblyClass.Methods[0].Parameters[0].ParameterType.AssemblyQualifiedName;

                                //Response
                                s.Response = wAssemblyClass.Methods[0].ReturnType.AssemblyQualifiedName;

                                list.Add(s);
                            }
                        }
                    }
                }

                var ordenedList = from x in list orderby x.Name select x;
                serviceConfigurationCollectionBindingSource.DataSource = ordenedList;
            }
            catch (System.Reflection.ReflectionTypeLoadException rx)
            {
                base.ExceptionViewer.Show(rx.LoaderExceptions, "Service Management:. Loading assembly");
                _StorageFactory.Clear();
            }
            catch (Exception ex)
            {
                base.ExceptionViewer.Show(ex);
                _StorageFactory.StorageObject.AssemblyPath = string.Empty;
                _StorageFactory.Save();
            }
        }
        void LoadAssembly()
        {
            try
            {
                if (!System.IO.File.Exists(ControllerTest.Storage.StorageObject.AssemblyPath))
                {
                    return;
                }
                Assembly wAssembly = new Assembly(ControllerTest.Storage.StorageObject.AssemblyPath);
                Fwk.Bases.ServiceConfiguration           wServiceConfiguration = null;
                Fwk.Bases.ServiceConfigurationCollection list = new Fwk.Bases.ServiceConfigurationCollection();
                lblFileName.Text = ControllerTest.Storage.StorageObject.AssemblyPath;

                foreach (AssemblyClass wAssemblyClass in wAssembly.ClassCollections)
                {
                    if (wAssemblyClass.BaseType != null)
                    {
                        if (wAssemblyClass.BaseType.Name.Contains("BusinessService"))
                        {
                            wServiceConfiguration = new Fwk.Bases.ServiceConfiguration();
                            //Service name
                            wServiceConfiguration.Name    = wAssemblyClass.Name;
                            wServiceConfiguration.Handler = wAssemblyClass.FullyQualifiedName;
                            //Request
                            wServiceConfiguration.Request = wAssemblyClass.Methods[0].Parameters[0].ParameterType.AssemblyQualifiedName;

                            //Response
                            wServiceConfiguration.Response = wAssemblyClass.Methods[0].ReturnType.AssemblyQualifiedName;

                            list.Add(wServiceConfiguration);
                        }
                    }
                }

                serviceConfigurationCollectionBindingSource.DataSource = list.OrderBy(p => p.Name);
            }
            catch (System.Reflection.ReflectionTypeLoadException rx)
            {
                base.ExceptionViewer.Show(rx.LoaderExceptions, "Service Management:. Loading assembly");
                //ControllerTest.Storage.Clear();
            }
            catch (Exception ex)
            {
                base.ExceptionViewer.Show(ex);
                //ControllerTest.Storage.Clear();
            }
        }
示例#6
0
        /// <summary>
        ///
        /// </summary>
        public void Populate()
        {
            if (this.EntityParam == null)
            {
                return;
            }
            Fwk.Bases.ServiceConfiguration wServiceConfiguration = (Fwk.Bases.ServiceConfiguration) this.EntityParam;
            bindingSourceService.DataSource = wServiceConfiguration;



            int index = cboIsolationLevel.FindStringExact(Enum.GetName(typeof(Fwk.Transaction.IsolationLevel), wServiceConfiguration.IsolationLevel));

            cboIsolationLevel.SelectedIndex = index;
            index = cboTransactionalBehaviour.FindStringExact(Enum.GetName(typeof(Fwk.Transaction.TransactionalBehaviour), wServiceConfiguration.TransactionalBehaviour));
            cboTransactionalBehaviour.SelectedIndex = index;
        }
示例#7
0
        void LoadAssembly()
        {

            try
            {
                Assembly wAssembly = new Assembly(_StorageFactory.StorageObject.AssemblyPath);
                Fwk.Bases.ServiceConfiguration s = null;
                Fwk.Bases.ServiceConfigurationCollection list = new Fwk.Bases.ServiceConfigurationCollection();
                lblFileName.Text = _StorageFactory.StorageObject.AssemblyPath;

                foreach (AssemblyClass wAssemblyClass in wAssembly.ClassCollections)
                {
                    if (wAssemblyClass.BaseType != null)
                    {
                        if (wAssemblyClass.BaseType.Name.Contains("BusinessService"))
                        {
                            if (!Services.Exists(p => p.Name.Equals(wAssemblyClass.Name.Trim())))
                            {
                                s = new Fwk.Bases.ServiceConfiguration();
                                //Service name
                                s.Name = wAssemblyClass.Name;
                                s.Handler = wAssemblyClass.FullyQualifiedName;
                                //Request
                                s.Request = wAssemblyClass.Methods[0].Parameters[0].ParameterType.AssemblyQualifiedName;

                                //Response
                                s.Response = wAssemblyClass.Methods[0].ReturnType.AssemblyQualifiedName;

                                list.Add(s);
                            }
                        }
                    }
                }

                var ordenedList = from x in list orderby x.Name select x;
                serviceConfigurationCollectionBindingSource.DataSource = ordenedList;
            }
            catch (System.Reflection.ReflectionTypeLoadException rx)
            {
                base.ExceptionViewer.Show(rx.LoaderExceptions, "Service Management:. Loading assembly");
                _StorageFactory.Clear();
            }
            catch (Exception ex)
            {

                base.ExceptionViewer.Show(ex);
                _StorageFactory.StorageObject.AssemblyPath = string.Empty;
                _StorageFactory.Save();
            }
        }
示例#8
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(Fwk.Bases.ServiceConfiguration pServiceConfiguration)
 {
     throw new NotImplementedException();
     //wFwkRemoteObject.AddServiceConfiguration(_ServiceMetadataProviderName, pServiceConfiguration);
 }
示例#9
0
        /// <summary>
        /// 
        /// </summary>
        public void FillServiceConfiguration()
        {
            Fwk.Bases.ServiceConfiguration wServiceConfiguration = new Fwk.Bases.ServiceConfiguration();
            wServiceConfiguration = (Fwk.Bases.ServiceConfiguration)bindingSourceService.DataSource;
            wServiceConfiguration.IsolationLevel = (Fwk.Transaction.IsolationLevel)Enum.Parse(typeof(Fwk.Transaction.IsolationLevel), cboIsolationLevel.Text);
            wServiceConfiguration.TransactionalBehaviour = (Fwk.Transaction.TransactionalBehaviour)Enum.Parse(typeof(Fwk.Transaction.TransactionalBehaviour), cboTransactionalBehaviour.Text);

            this.EntityResult = wServiceConfiguration;
        }
示例#10
0
        void LoadAssembly()
        {
           
            try
            {
                if (!System.IO.File.Exists(ControllerTest.Storage.StorageObject.AssemblyPath))
                    return;
                Assembly wAssembly = new Assembly(ControllerTest.Storage.StorageObject.AssemblyPath);
                Fwk.Bases.ServiceConfiguration wServiceConfiguration = null;
                Fwk.Bases.ServiceConfigurationCollection list = new Fwk.Bases.ServiceConfigurationCollection();
                lblFileName.Text = ControllerTest.Storage.StorageObject.AssemblyPath;

                foreach (AssemblyClass wAssemblyClass in wAssembly.ClassCollections)
                {
                    if (wAssemblyClass.BaseType != null)
                    {
                        if (wAssemblyClass.BaseType.Name.Contains("BusinessService"))
                        {
                            wServiceConfiguration = new Fwk.Bases.ServiceConfiguration();
                            //Service name
                            wServiceConfiguration.Name = wAssemblyClass.Name;
                            wServiceConfiguration.Handler = wAssemblyClass.FullyQualifiedName;
                            //Request
                            wServiceConfiguration.Request = wAssemblyClass.Methods[0].Parameters[0].ParameterType.AssemblyQualifiedName;

                            //Response
                            wServiceConfiguration.Response = wAssemblyClass.Methods[0].ReturnType.AssemblyQualifiedName;

                            list.Add(wServiceConfiguration);
                        }
                    }
                }

                serviceConfigurationCollectionBindingSource.DataSource = list.OrderBy (p=> p.Name );
            }
            catch (System.Reflection.ReflectionTypeLoadException rx)
            {
                base.ExceptionViewer.Show(rx.LoaderExceptions, "Service Management:. Loading assembly");
                //ControllerTest.Storage.Clear();
            }
            catch (Exception ex)
            {

                base.ExceptionViewer.Show(ex);
                //ControllerTest.Storage.Clear();
            }
        }