Example #1
0
        /// <summary>
        /// Consulta los metodos distintos para obtener los diferentes condigos a consultar (telefonico, moneda,acronimo,gmt)
        /// </summary>
        /// <param name="pais"> Nombre del pais a Consultar</param>
        /// <returns>Una lista de string con los resultados de las consultas</returns>
        public List <string> ConsultarPais(string pais)
        {
            List <String> result;

            try
            {
                result = new List <string>();
                countrySoapClient cs = new countrySoapClient("countrySoap");

                string isd    = cs.GetISD(pais);
                string moneda = cs.GetCurrencyByCountry(pais);
                string gmt    = cs.GetGMTbyCountry(pais);

                XmlDocument doc = new XmlDocument();
                doc.LoadXml(isd);//consultamos por condigoTelefonico
                XmlNodeList elemList = doc.GetElementsByTagName("code");
                result.Add("Código Telefónico: " + elemList[0].InnerText);

                doc.LoadXml(moneda);//Consultamos por moneda
                elemList = doc.GetElementsByTagName("CurrencyCode");
                result.Add("Moneda: " + elemList[0].InnerText);
                elemList = doc.GetElementsByTagName("CountryCode");
                result.Add("Acronimo: " + elemList[0].InnerText);

                doc.LoadXml(gmt);//Consultamos por zona horaria
                elemList = doc.GetElementsByTagName("GMT");
                result.Add("Zona Horaria: " + elemList[0].InnerText);

                return(result);
            }
            catch (Exception)
            {
                return(result = null);
            }
        }
Example #2
0
File: App.cs Project: wsabor/AX
        public App()
        {
            countrySoapClient CS = new countrySoapClient(new BasicHttpBinding(),
                                                         new EndpointAddress("http://www.webservicex.net/country.asmx"));

            CS.GetCountriesCompleted += CS_GetCountriesCompleted;
            CS.GetCountriesAsync();

            // The root page of your application
            //MainPage = new ContentPage
            //{
            //    Content = new StackLayout
            //    {
            //        VerticalOptions = LayoutOptions.Center,
            //        Children = {
            //            new Label {
            //                XAlign = TextAlignment.Center,
            //                Text = "Welcome to Xamarin Forms!"
            //            }
            //        }
            //    }
            //};
        }
Example #3
0
 public ActionResult Index()
 {
     var client = new countrySoapClient("countrySoap");
     ViewBag.Data = client.GetCountries();
     return View();
 }
 public void Retrieve()
 {
     var soapClient = new countrySoapClient();
     soapClient.GetCurrencyCodeCompleted += SoapClientGetCurrencyCodeCompleted;
     soapClient.GetCurrencyCodeAsync();
 }
Example #5
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            var client = new countrySoapClient();

            client.GetCountries();
        }
Example #6
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            var client = new countrySoapClient("countrySoap");

            LabelGmt.Text = client.GetGMTbyCountry(TextBox1.Text);
        }