static void Main(string[] args) { RestDemoServices demoServices = new RestDemoServices(); WebServiceHost _serviceHost = new WebServiceHost(demoServices, new Uri("http://localhost:8000/DemoService")); _serviceHost.Open(); Console.ReadKey(); _serviceHost.Close(); }
static void Main(string[] args) { Thread thread = new Thread(new ThreadStart(SocketPhoto.SERVICE)); thread.Start(); RestDemoServices DemoServices = new RestDemoServices(); WebHttpBinding binding = new WebHttpBinding(); WebHttpBehavior behavior = new WebHttpBehavior(); WebServiceHost _serviceHost = new WebServiceHost(DemoServices, new Uri("http://localhost:8008/DEMOService")); _serviceHost.AddServiceEndpoint(typeof(IRESTDemoServices), binding, ""); _serviceHost.Open(); Console.ReadKey(); _serviceHost.Close(); }
static void Main(string[] args) { RestDemoServices DemoServices = new RestDemoServices(); WebHttpBinding binding = new WebHttpBinding(); WebHttpBehavior behavior = new WebHttpBehavior(); WebServiceHost _serviceHost = new WebServiceHost(DemoServices, new Uri("http://localhost:8000/DEMOService")); _serviceHost.AddServiceEndpoint(typeof(IRESTDemoServices), binding, ""); _serviceHost.Open(); Console.ReadKey(); _serviceHost.Close(); using (HttpSelfHostServer server = new HttpSelfHostServer(config)) { server.OpenAsync().Wait(); Console.WriteLine("---- MyConcert ---- Servidor API -----"); Console.WriteLine("Presione ENTER para cerrar."); Console.ReadLine(); Console.WriteLine("Confirmacion..."); Console.ReadLine(); } }