Tema: Login XML
Ver Mensaje Individual
  #1 (permalink)  
Antiguo 19/11/2012, 19:16
rimander
 
Fecha de Ingreso: febrero-2011
Mensajes: 111
Antigüedad: 13 años, 3 meses
Puntos: 0
Login XML

Hola tengo un webservice y al enviar unos parametros me devuelve un xml.

He probado varios sistemas para poder obtener el xml y no me conecta nunca.
Os dejo el código por si alguien puede ayudarme, si no le agradecería que me agregase skype para que me lo explique.

Código:
public String url() throws IOException{
		 URL url = new URL("xxxxxxxxxxx.com");
         URLConnection connection = url.openConnection();
         HttpURLConnection httpConn = (HttpURLConnection)connection;
         httpConn.setDoInput(true);
         httpConn.setRequestProperty("charset", "utf-8");
         int responseCode = httpConn.getResponseCode();
         if(responseCode != HttpStatus.SC_OK) {
             InputStream xmlStream = httpConn.getInputStream();

             // Pass the xmlStream object to a XPP, SAX or DOM parser.
         }
		return null;
	}