public GreetConsumer(Channel channel) { _channel = channel; _greet = new Greet() { FirstName = "Palash", LastName = "Debnath" }; _greetRequest = new GreetRequest() { Greet = _greet }; _greetServiceClient = new GreetServiceClient(_channel); }
static void Main(string[] args) { GreetServiceClient service = new GreetServiceClient("BasicHttpBinding_IGreetService"); Name current = new Name(); Console.WriteLine("Enter firstname: "); current.Firstname = Console.ReadLine(); Console.WriteLine("Enter lastname: "); current.Lastname = Console.ReadLine(); Console.WriteLine(service.Greet(current)); Console.ReadKey(); }