Ver Mensaje Individual
  #1 (permalink)  
Antiguo 04/09/2013, 01:14
elbrocheta
 
Fecha de Ingreso: diciembre-2006
Mensajes: 65
Antigüedad: 17 años, 4 meses
Puntos: 1
Problema con WebService .Net

Estoy creando una app que debe enviar una serie de datos vía WS. El problema que tengo es que no llegan los datos al WS.

De momento el código del WS es muy simple. Recibe un string y lo devuelve junto con la hora. En la app de android sólo recibo la hora y no el parámetro

Código del WS

Código:
using System;
using System.Web.Services;


[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]

public class WS_Android : System.Web.Services.WebService {

    [WebMethod]
    public string p_MPL_set_id(string v_id_device)
    {        
        String a_data = DateTime.Now.Hour.ToString() + ":" + DateTime.Now.Minute.ToString() + ":" + DateTime.Now.Second.ToString() + " --> " + v_id_device;

        return a_data;
    }
    
}
Código de mi app android:

Código:
try {
   

	SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
					
	String a_id = Secure.getString(getBaseContext().getContentResolver(), Secure.ANDROID_ID);
				
	PropertyInfo pi = new PropertyInfo();
	pi.setName("v_id");
	pi.setValue(a_id);
	pi.setType(String.class);
	request.addProperty(pi);
					
					
	SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
	envelope.dotNet = true;
	envelope.setOutputSoapObject(request);

	HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
	androidHttpTransport.call(SOAP_ACTION, envelope);

	Object result = (Object) envelope.getResponse();

	r_id = result.toString();

	androidHttpTransport.reset();
					
	} catch (Exception e) {
		C_MPL_LOG.p_MPL_log(e.getMessage());
		C_MPL_LOG.p_MPL_log(e.toString());
	}