Exemplo n.º 1
0
        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();
        }
Exemplo n.º 2
0
        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();
        }
Exemplo n.º 3
0
        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();
            }
        }