示例#1
0
 private void btn_Close_Click(object sender, EventArgs e)
 {
     if (client != null)
     {
         Print("Closing a client ...");
         client.Close();
         client = null;
     }
     else
     {
         Print("Error! Client does not exist!");
     }
     this.Close();
 }
示例#2
0
        private static void SVInvoke()
        {
            //var sv = new ServiceReference1.Service1Client();
            //sv.DoWork();
            MyServiceClient client = new MyServiceClient();
            client.DoWork();
            client.Close();



            //MyService2Client client = new MyService2Client();
            //client.DoWork();

            //var channelFactory = new ChannelFactory<IMyService>("WSHttpBinding_IMyService");
            //var client1 = channelFactory.CreateChannel();
            //var os = proxy.MyTransparentProxy.Create<IMyService>(client1);
            //os.DoWork();
        }
示例#3
0
        private static void SVInvoke()
        {
            //var sv = new ServiceReference1.Service1Client();
            //sv.DoWork();
            MyServiceClient client = new MyServiceClient();

            client.DoWork();
            client.Close();



            //MyService2Client client = new MyService2Client();
            //client.DoWork();

            //var channelFactory = new ChannelFactory<IMyService>("WSHttpBinding_IMyService");
            //var client1 = channelFactory.CreateChannel();
            //var os = proxy.MyTransparentProxy.Create<IMyService>(client1);
            //os.DoWork();
        }
示例#4
0
 static void TestService()
 {
     var client = new MyServiceClient();
     var hello = client.Hello();
     Console.WriteLine(hello);
     client.Close();
 }