private void btnCallHttpDual_Click(object sender, EventArgs e) { try { System.ServiceModel.InstanceContext site = new System.ServiceModel.InstanceContext(new EchoServiceCallbackHandler()); asyncClient = new EchoServiceClient(site, "dualHttpEndPoint"); this.txtStatus.Text += String.Format("Connected...{0}\r\n", asyncClient.Endpoint.Address.Uri.AbsoluteUri); // invoke service operation this.txtStatus.Text += String.Format("Invoking Duplex endpoint: AsyncEchoJob1\r\n"); asyncClient.EchoJobStart("AsyncEchoJob1"); } catch (TimeoutException timeProblem) { this.txtStatus.Text += String.Format("The service operation timed out....{0}\r\n", timeProblem.Message); asyncClient.Abort(); } catch (System.ServiceModel.CommunicationException commProblem) { this.txtStatus.Text += String.Format("There was a communication problem....{0}\r\n", commProblem.Message); asyncClient.Abort(); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } finally { this.txtStatus.Text += String.Format("--------------------------------------\r\n"); } }