// IsOneWay = true // Operations in progress block clients. They are queued and executed one after the other. private void buttonRequestReplyOperation_Click(object sender, EventArgs e) { try { listBox1.Items.Add($"Request-Reply Operation Started @{DateTime.Now}"); buttonRequestReplyOperation.Enabled = false; listBox1.Items.Add(client.RequestReplyOperation()); buttonRequestReplyOperation.Enabled = true; listBox1.Items.Add($"Request-Reply Operation Completed @{DateTime.Now}"); listBox1.Items.Add(string.Empty); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void BtnRequestReplyOperation_Click(object sender, EventArgs e) { try { listBox1.Items.Add("Request-Reply Operation Started @ " + DateTime.Now.ToString()); BtnRequestReplyOperation.Enabled = false; listBox1.Items.Add(client.RequestReplyOperation()); BtnRequestReplyOperation.Enabled = true; listBox1.Items.Add("Request-Reply Operation Completed @ " + DateTime.Now.ToString()); listBox1.Items.Add(""); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
public ActionResult RequestReplyOperation() { string message; try { SampleServiceClient client = new SampleServiceClient(); string processingTime = client.RequestReplyOperation(); message = $"Request-Reply Operation Completed @ {DateTime.Now} - {processingTime}"; } catch (Exception ex) { message = ex.Message; } return(PartialView("RequestReplyOperation", message)); }