Esempio n. 1
0
        private async void NumWcfButton_Click(object sender, EventArgs e)
        {
            var svc    = new FirstWcfSvc.FirstWcfServiceClient();
            var number = Convert.ToInt32(NameTextBox.Text);
            var result = await svc.NumToEngAsync(number);

            MessageBox.Show(result);
        }
Esempio n. 2
0
 private void FaultButton_Click(object sender, EventArgs e)
 {
     try
     {
         var svc = new FirstWcfSvc.FirstWcfServiceClient();
         var c   = svc.Div(20, 0);
         MessageBox.Show(string.Format($"c: {c}", c));
     }
     catch (FaultException <FirstWcfSvc.DivFault> ex)
     {
         MessageBox.Show(ex.Code.Name);
         MessageBox.Show(string.Format(
                             $"A: {ex.Detail.A}, B: {ex.Detail.B}"));
         MessageBox.Show(ex.ToString());
     }
 }