Пример #1
0
        public Tuple <WebServiceHost, Uri> InitServiceHost(Type hostType, string serviceSchema,
                                                           string serviceNamespace, string servicePath)
        {
            var address = ServiceBusEnvironment.CreateServiceUri(serviceSchema, serviceNamespace, servicePath);
            var host    = new WebServiceHost(hostType, address);

            host.AddDefaultEndpoints();
            host.Open();

            return(Tuple.Create(host, address));
        }
Пример #2
0
        public ServiceHost(ILog log, IStatusMonitor statusMonitor)
        {
            Log           = log;
            StatusMonitor = statusMonitor;
            _host         = new WebServiceHost(typeof(Service), ServiceUri);
            // TODO: Enable HTTPS - http://stackoverflow.com/questions/14933696
            _host.AddDefaultEndpoints()[0].Binding = new WebHttpBinding();
            _host.Description.Endpoints[0].Behaviors.Add(new WebHttpBehavior {
                HelpEnabled = true
            });

            _webAppHost = new WebServiceHost(typeof(WebServer), WebAppUri);
            _webAppHost.AddDefaultEndpoints()[0].Binding = new WebHttpBinding();
            _webAppHost.Description.Endpoints[0].Behaviors.Add(new WebHttpBehavior());
        }