Пример #1
0
 // IsOneWay = true
 // Throwed exceptions breaks connection to service. Subsequent operations are not possible to execute w/o creating a new connection to the service.
 private void buttonRequestReplyOperationThrowException_Click(object sender, EventArgs e)
 {
     try
     {
         listBox1.Items.Add($"Request-Reply Operation ThrowException Started @{DateTime.Now}");
         client.RequestReplyOperation_ThrowsException();
         listBox1.Items.Add($"Request-Reply Operation ThrowException Completed @{DateTime.Now}");
         listBox1.Items.Add(string.Empty);
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Пример #2
0
        public ActionResult RequestReplyOperation_ThrowsException()
        {
            string message = string.Empty;

            try
            {
                SampleServiceClient client = new SampleServiceClient();
                client.RequestReplyOperation_ThrowsException();
            }
            catch (Exception ex)
            {
                message = $"Request-Reply Throws Exception Operation Completed @ {DateTime.Now} {ex.Message}";
            }

            return(PartialView("RequestReplyOperation_ThrowsException", message));
        }
Пример #3
0
 private void BtnRequestReplyOperationThrowsException_Click(object sender, EventArgs e)
 {
     try
     {
         listBox1.Items.Add("RequestReplyOperation_ThrowsException Started @ " + DateTime.Now.ToString());
         BtnRequestReplyOperationThrowsException.Enabled = false;
         listBox1.Items.Add(client.RequestReplyOperation_ThrowsException());
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
     finally
     {
         BtnRequestReplyOperationThrowsException.Enabled = true;
         listBox1.Items.Add("RequestReplyOperation_ThrowsException Completed @ " + DateTime.Now.ToString());
         listBox1.Items.Add("");
     }
 }