Ejemplo n.º 1
0
        private async static void GetNameAsync()
        {
            using (ChannelFactory <PersonService.WcfService> channelFactory = new ChannelFactory <PersonService.WcfService>("WSHttpBinding_WcfService"))
            {
                PersonService.WcfService proxy = channelFactory.CreateChannel();
                using (proxy as IDisposable)
                {
                    Thread.Sleep(20);
                    string res = await proxy.getNameAsync("myName by async Test");

                    Console.WriteLine(res);
                }
            }
        }