Example #1
0
        /// <summary>
        ///     Starts a <see cref="ServiceHost" /> for each found service. Defaults to <see cref="BasicHttpBinding" /> if
        ///     no user specified binding is found
        /// </summary>
        public void Startup(Unicast.UnicastBus bus)
        {
            Bus = bus;
            var conventions = bus.Builder.Build<Conventions>();
            var components = bus.Builder.Build<IConfigureComponents>();

            foreach (var serviceType in bus.Settings.GetAvailableTypes().Where(t => !t.IsAbstract && IsWcfService(t, conventions)))
            {
                var host = new WcfServiceHost(serviceType);

                Binding binding = new BasicHttpBinding();

                if (components.HasComponent<Binding>())
                {
                    binding = bus.Builder.Build<Binding>();
                }

                host.AddDefaultEndpoint(GetContractType(serviceType),
                    binding
                    , String.Empty);

                hosts.Add(host);

                logger.Debug("Going to host the WCF service: " + serviceType.AssemblyQualifiedName);
                host.Open();
            }
        }
        /// <summary>
        ///     Starts a <see cref="ServiceHost" /> for each found service. Defaults to <see cref="BasicHttpBinding" /> if
        ///     no user specified binding is found
        /// </summary>
        public void Startup(Unicast.UnicastBus bus)
        {
            Bus = bus;
            var conventions = bus.Builder.Build <Conventions>();
            var components  = bus.Builder.Build <IConfigureComponents>();

            foreach (var serviceType in bus.Settings.GetAvailableTypes().Where(t => !t.IsAbstract && IsWcfService(t, conventions)))
            {
                var host = new WcfServiceHost(serviceType);

                Binding binding = new BasicHttpBinding();

                if (components.HasComponent <Binding>())
                {
                    binding = bus.Builder.Build <Binding>();
                }

                host.AddDefaultEndpoint(GetContractType(serviceType),
                                        binding
                                        , String.Empty);

                hosts.Add(host);

                host.Open();
            }
        }
Example #3
0
        /// <summary>
        /// Starts a servicehost for each found service. Defaults to BasicHttpBinding if
        /// no user specified binding is found
        /// </summary>
        public void Startup()
        {
            foreach (var serviceType in Configure.TypesToScan.Where(t => !t.IsAbstract && IsWcfService(t)))
            {
                var host = new WcfServiceHost(serviceType);

                Binding binding = new BasicHttpBinding();

                if (Configure.Instance.Configurer.HasComponent<Binding>())
                    binding = Configure.Instance.Builder.Build<Binding>();

                host.AddDefaultEndpoint(   GetContractType(serviceType),
                                           binding
                                           ,"");

                hosts.Add(host);

                logger.Debug("Going to host the WCF service: " + serviceType.AssemblyQualifiedName);
                host.Open();
            }
        }
Example #4
0
        /// <summary>
        /// Starts a servicehost for each found service. Defaults to BasicHttpBinding if
        /// no user specified binding is found
        /// </summary>
        public void Startup()
        {
            foreach (var serviceType in Configure.TypesToScan.Where(t => !t.IsAbstract && IsWcfService(t)))
            {
                var host = new WcfServiceHost(serviceType);

                Binding binding = new BasicHttpBinding();

                if (Configure.Instance.Configurer.HasComponent <Binding>())
                {
                    binding = Configure.Instance.Builder.Build <Binding>();
                }

                host.AddDefaultEndpoint(GetContractType(serviceType),
                                        binding
                                        , "");

                hosts.Add(host);

                logger.Debug("Going to host the WCF service: " + serviceType.AssemblyQualifiedName);
                host.Open();
            }
        }