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(); } }
public Form1() { InitializeComponent(); client = new SWcfService.SWcfServiceClient(); }