Esempio n. 1
0
        private int ComputeFibonacci()
        {
            // Asynchronously call the Web service Fibonacci(10)
            // on your localhost
            ComputationWebServiceReference.ComputationWebServiceSoapClient client =
                new ComputationWebServiceReference.ComputationWebServiceSoapClient();
            int result = client.Fibonacci(10);

            // Simulate computation latency
            Thread.Sleep(2000);
            return(result);
        }
Esempio n. 2
0
        private void button2_Click(object sender, EventArgs e)
        {
            ComputationWebServiceReference.ComputationWebServiceSoapClient client =
                new ComputationWebServiceReference.ComputationWebServiceSoapClient();
            string str    = textBox1.Text;
            string result = client.XmlToJson(str);

            // Form disapears
            Hide();

            // Web service returns the result
            MessageBox.Show(result.ToString());
        }