Exemplo n.º 1
0
        private void btnReverse_Click(object sender, EventArgs e)
        {
            string str1 = txtStr1.Text.ToString();

            // WebServiceSample.SampleServiceSoapClient svc = new WebServiceSample.SampleServiceSoapClient();
            SampleSvc.SampleServiceSoapClient svc = new SampleSvc.SampleServiceSoapClient();
            svc.ReverseStringCompleted += Svc_ReverseStringCompleted;
            //txtStr2.Text = svc.ReverseString(str1);
            svc.ReverseStringAsync(str1);
        }
Exemplo n.º 2
0
        private void btnGetWeather_Click(object sender, EventArgs e)
        {
            GetWeatherRequest req = new GetWeatherRequest();

            if (rabCelsius.Checked)
            {
                req.TemperatureType = TemperatureType.Celsius;
            }
            else
            {
                req.TemperatureType = TemperatureType.Fahrenheit;
            }

            req.City = txtCity.Text;

            SampleSvc.SampleServiceSoapClient svc = new SampleSvc.SampleServiceSoapClient();
            GetWeatherResponse resp = svc.GetWeature(req);

            txtTemperature.Text  = resp.Temperature.ToString();
            txtWeaCondition.Text = resp.Condition.ToString();
        }