using System;
using DemoServices.ServiceContracts;
using DemoServices.Messages;

namespace DemoServices.ServiceImplementations
{
    public class SimpleGreetingService : IGreetingService
    {
        public GreetingResponse SayHello(GreetingRequest request)
        {
            //OperationContext.Current.RequestContext.RequestMessage
            Console.WriteLine("SimpleGreetingService : {0}", request.Name);
            GreetingResponse response = new GreetingResponse();
            response.Message = String.Format("Hello {0}! I am Greeting Service at \n{1}", request.Name, 
                System.ServiceModel.OperationContext.Current.Host.BaseAddresses[0]);
            return response;
        }
    }
}
