Esempio n. 1
0
        private void StartTasks()
        {
            var clientQuote = new ServiceReferenceQuotes.DelayedStockQuoteSoapClient("DelayedStockQuoteSoap");
            taskQuotes = clientQuote.GetQuickQuoteAsync(txtQuotesInput.Text, "0");

            var clientQuoteFull = new ServiceReferenceQuotes.DelayedStockQuoteSoapClient("DelayedStockQuoteSoap");
            taskQuotesFull = clientQuoteFull.GetQuoteAsync(txtQuotesFullInput.Text, "0");

            var clientResolve = new ServiceResolve.P2GeoSoapClient("IP2GeoSoap");
            taskResolve = clientResolve.ResolveIPAsync(txtResolveInput.Text, "0");

            var clientTemperature = new ServiceTemperature.ConvertTemperatureSoapClient("ConvertTemperatureSoap");
            taskTemperature = clientTemperature.ConvertTempAsync(
                Convert.ToDouble(txtTemperatureInput.Text), ServiceTemperature.TemperatureUnit.degreeCelsius, ServiceTemperature.TemperatureUnit.kelvin);

            var clientCurrency = new ServiceCurrency.CurrencyConvertorSoapClient("CurrencyConvertorSoap");
            taskCurrency = clientCurrency.ConversionRateAsync(ServiceCurrency.Currency.USD, ServiceCurrency.Currency.JPY);

            var clientWeather = new ServiceWeather.GlobalWeatherSoapClient("GlobalWeatherSoap");
            taskWeather = clientWeather.GetWeatherAsync(txtWeatherInput.Text, txtWeatherInput1.Text);
        }
Esempio n. 2
0
 private void btnCurrency_Click(object sender, EventArgs e)
 {
     var watch = new Stopwatch();
     watch.Start();
     var serviceClient = new ServiceCurrency.CurrencyConvertorSoapClient("CurrencyConvertorSoap");
     txtCurrencyOutput.Text = serviceClient.ConversionRate(ServiceCurrency.Currency.USD, ServiceCurrency.Currency.JPY).ToString();
     watch.Stop();
     txtCurrencyWatch.Text = watch.ElapsedMilliseconds.ToString();
     //EURUSD 1,0763
     //USDEUR 0,9289
     //PLNUSD 0,253
     //PLNEUR 0,235
     //USDJPY 123,085
 }