﻿using System;
using System.ServiceModel;
using TestContracts.Contracts;
using Zulu.WCF.ServiceModel.Services;

namespace TestServices
{
    internal static class Program
    {
        private static ServiceHost _service;

        private static void Main()
        {
            BindRequestToProcessors();
            _service = new ServiceHost(typeof (TestService));
            _service.Open();
            Console.WriteLine("TestService is running");
            Console.WriteLine("Press any key to stop");
            Console.ReadKey();
            _service.Close();
        }

        private static void BindRequestToProcessors()
        {
            SoapServiceProcessor.Bind<CreateClientRequest, ClientProcessor>();
            SoapServiceProcessor.Bind<UpdateClientRequest, ClientProcessor>();
            SoapServiceProcessor.Bind<DeleteClientRequest, ClientProcessor>();
            SoapServiceProcessor.Bind<GetClientRequest, ClientProcessor>();
        }
    }
}