Example #1
0
        private void _load_web_host()
        {
            Uri _web_http_url = new Uri(
                System.Configuration.ConfigurationManager.AppSettings["Web_HTTP_Url"]);

            _web_service_host = new System.ServiceModel.Web.WebServiceHost(wcf_service, _web_http_url);
            //Añadimos endpoint web
            System.ServiceModel.Description.ServiceEndpoint epoint =
                _web_service_host.AddServiceEndpoint(_service_interface, new System.ServiceModel.WebHttpBinding(), _web_http_url);

            //Vamos a añadir la carateristica de autoformato en response
            System.ServiceModel.Description.WebHttpBehavior wbhttp =
                epoint.Behaviors.Find <System.ServiceModel.Description.WebHttpBehavior>();

            if (wbhttp != null)
            {
                wbhttp.AutomaticFormatSelectionEnabled = true;
                wbhttp.HelpEnabled = true;
            }
            else
            {
                wbhttp = new System.ServiceModel.Description.WebHttpBehavior();
                wbhttp.AutomaticFormatSelectionEnabled = true;
                wbhttp.HelpEnabled           = true;
                wbhttp.FaultExceptionEnabled = true;
                epoint.Behaviors.Add(wbhttp);
            }
        }
Example #2
0
 public void StopHTTPService()
 {
     if (_HTTPserviceHost != null)
     {
         _HTTPserviceHost.Close();
         _HTTPserviceHost = null;
     }
 }
Example #3
0
        static App()
        {
            DispatcherHelper.Initialize();

            var serviceHost = new System.ServiceModel.Web.WebServiceHost(typeof(FluentAutomation.RemoteCommands.ServiceEndpoint), new Uri("http://localhost:10001/"));

            serviceHost.Open();
        }
Example #4
0
 public WebServiceHost()
 {
     _tcpBaseAddress = "net.tcp://localhost:" + Globals.ClientTcpPort + "/V1";
     _httpBaseAddress = "http://localhost:" + Globals.ClientHttpPort + "/V1";
     List<Uri> addresses = new List<Uri>() { new Uri(_httpBaseAddress), new Uri(_tcpBaseAddress)};
     _host = new System.ServiceModel.Web.WebServiceHost(typeof(Service), addresses.ToArray());
     IsOpen = false;
 }
Example #5
0
        /// <summary>
        /// Start the HTTP Service
        /// </summary>
        /// <param name="NetTCPServiceHost"></param>
        public void StartHTTPService()
        {
            if (_HTTPserviceHost != null)
            {
                _HTTPserviceHost.Close();
            }
            _HTTPserviceHost = null;

            _HTTPserviceHost = new System.ServiceModel.Web.WebServiceHost(typeof(wcfTeenService.wcf.TeenService));
            _HTTPserviceHost.Open();
        }
Example #6
0
        /// <summary>
        /// Start the HTTP Service
        /// </summary>
        /// <param name="NetTCPServiceHost"></param>
        public void StartHTTPService()
        {
            if (_HTTPserviceHost != null)
            {
                _HTTPserviceHost.Close();
            }
            _HTTPserviceHost = null;

            _HTTPserviceHost = new System.ServiceModel.Web.WebServiceHost(typeof(wcfTeenService.wcf.TeenService));
            _HTTPserviceHost.Open();
        }
        private void _load_web_host()
        {
            Uri _web_http_url = new Uri(
                System.Configuration.ConfigurationManager.AppSettings["Web_HTTP_Url"]);
            _web_service_host = new System.ServiceModel.Web.WebServiceHost(wcf_service, _web_http_url);
            //Añadimos endpoint web
            System.ServiceModel.Description.ServiceEndpoint epoint =
                _web_service_host.AddServiceEndpoint(_service_interface, new System.ServiceModel.WebHttpBinding(), _web_http_url);

            //Vamos a añadir la carateristica de autoformato en response
            System.ServiceModel.Description.WebHttpBehavior wbhttp =
                epoint.Behaviors.Find<System.ServiceModel.Description.WebHttpBehavior>();

            if (wbhttp != null)
            {
                wbhttp.AutomaticFormatSelectionEnabled = true;
                wbhttp.HelpEnabled = true;
            }
            else
            {
                wbhttp = new System.ServiceModel.Description.WebHttpBehavior();
                wbhttp.AutomaticFormatSelectionEnabled = true;
                wbhttp.HelpEnabled = true;
                wbhttp.FaultExceptionEnabled = true;
                epoint.Behaviors.Add(wbhttp);

            }
        }
Example #8
0
 public void StopHTTPService()
 {
     if (_HTTPserviceHost != null)
     {
         _HTTPserviceHost.Close();
         _HTTPserviceHost = null;
     }
 }