my code

Llamando a un servicio

Snippet options

Download: Download snippet as
Copy snippet: For this you need a free my code account.
Embed code : You will find the embed code for this snippet at the end of the page, if you want to embed it into a website or a blog!


	String NAMESPACE = "";
	String URL = "";
	String METHOD_NAME = "movilpolicial_lat_lng";
	String LAT = "";
	String LNG = "";


private class TareaWSConsulta extends AsyncTask<String, Integer, String>
		ProgressDialog pd;

		protected void onPreExecute()
			pd = new ProgressDialog(LayMain.this);;

		protected String doInBackground(String... params)
				SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
				request.addProperty("latitud", LAT);
				request.addProperty("longitud", LNG);
				request.addProperty("token", "wwfe345gQ3ed5T67g4Dase45F6fer");

				SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
				envelope.dotNet = true;
				HttpTransportSE transporte = new HttpTransportSE(URL);, envelope);
				String resultado_xml = envelope.getResponse().toString();
				return resultado_xml.toString();
			catch (Exception e)
				Log.e("SOAP", "SOAP");
			return "";

		protected void onPostExecute(String result)

Create a free my code account now.

my code is a free service, which allows you to save and manage code snippes of any kind and programming language. We provide many advantages for your daily work with code-snippets, also for your teamwork. Give it a try!

Find out more and register now

You can customize the height of iFrame-Codes as needed! You can find more infos in our API Reference for iframe Embeds.