protected void Button1_Click(object sender, EventArgs e) { var proxy = new StemmingServiceClient(); try { if (!String.IsNullOrWhiteSpace(txtInput.Text)) { var result = proxy.Stemming(txtInput.Text); lblResult.Text = result; } proxy.Close(); } catch (TimeoutException timeout) { lblResult.Text = timeout.Message; proxy.Abort(); } catch (CommunicationException commException) { lblResult.Text = commException.Message; proxy.Abort(); } }
protected void Button1_Click(object sender, EventArgs e) { var proxy = new StemmingServiceClient(); try { if (!String.IsNullOrWhiteSpace(txtInput.Text)) { var result = proxy.Stemming(txtInput.Text); lblResult.Text = result; } proxy.Close(); } catch (TimeoutException timeout) { lblResult.Text = timeout.Message; proxy.Abort(); } catch (CommunicationException commException) { lblResult.Text = commException.Message; proxy.Abort(); } }