using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;

namespace Client
{
    [ServiceContract]
    public interface IHelloServiceBus
    {
        [OperationContract]
        string SayHello(string name);
    }

    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("**** Client ****");
            Console.WriteLine("Press <Enter> to run client.");
            Console.ReadLine();

            ChannelFactory<IHelloServiceBus> channelFactory =
                new ChannelFactory<IHelloServiceBus>("DirectEndpoint");
            IHelloServiceBus channel = channelFactory.CreateChannel();

            string response = channel.SayHello("Service Bus");
            Console.WriteLine(response);

            channelFactory.Close();
        }
    }
}
