using System;
using System.ServiceModel;
using System.ServiceModel.Description;
using GeometryServiceLibrary;

namespace GeometryServiceHosts.SimplifiedConfigurationDemo
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("GeometryServiceHost starting");
            using (ServiceHost host = new ServiceHost(typeof(GeometryService),
                new Uri("http://localhost:2210/SimplifiedGeometryService"),
                new Uri("net.tcp://localhost:2211/SimplifiedGeometryService")))
            {
                host.Open();
                foreach (ServiceEndpoint se in host.Description.Endpoints)
                {
                    Console.WriteLine("\nAddress: {0}, \n\tBinding: {1}, \n\tContract: {2}", se.Address, se.Binding.Name, se.Contract.Name);
                }

                Console.WriteLine("GeometryServiceHost started. Press enter to stop.");
                Console.ReadLine();
            }

            Console.WriteLine("GeometryServiceHost stopped");
            Console.ReadLine();
        }
    }
}
