示例#1
0
 private void btnInvokeService_Click(object sender, EventArgs e)
 {
     try
     {
         lblCounter.Text = "Counter :" + client.IncrementCount().ToString() + "\n" +
                           "Session Id : " + client.InnerChannel.SessionId;
     }catch (System.ServiceModel.CommunicationException)
     {
         MessageBox.Show("Session Time out. Your exsiting session has lost" +
                         "Your new session is Created");
         client = new SWcfService.SWcfServiceClient();
     }
 }
示例#2
0
 public Form1()
 {
     InitializeComponent();
     client = new SWcfService.SWcfServiceClient();
 }