Пример #1
0
        private static void Main()
        {
            try
            {

                CallbackType callbackType = new CallbackType();
                InstanceContext instanceContext = new InstanceContext(callbackType);

                HelloIndigoContractClient client = new HelloIndigoContractClient(instanceContext);

                const string message = "Hello world!";
                Console.WriteLine("Send message \"{0}\" to server.", message);
                Console.WriteLine("Client started on thread {0}", Thread.CurrentThread.GetHashCode());
                Console.WriteLine();

                client.HelloIndigo(message);

            }
            catch (Exception ex)
            {
                while (ex != null)
                {
                    Console.WriteLine(ex.Message);
                    ex = ex.InnerException;
                }
            }
            Console.ReadLine();
        }
Пример #2
0
        static void Main(string[] args)
        {
            Console.WriteLine("Client running on thread {0}", Thread.CurrentThread.GetHashCode());
            Console.WriteLine();

            CallbackType    cb      = new CallbackType();
            InstanceContext context = new InstanceContext(cb);

            using (HelloIndigoContractClient proxy = new HelloIndigoContractClient(context))
            {
                Console.WriteLine("Calling HelloIndigo()");
                proxy.HelloIndigo("Hello from Client.");
                Console.WriteLine("Returned from HelloIndigo()");

                Console.ReadLine();
            }
        }