I am developing an android application... and I want to pass the data to asmx webservice via json object and I want the response of web service and access the data to the application.
Can anyone tell me how it is possible?
My Code Is:
Thread myThread = new Thread()
{
@Override
public void run()
{
SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
request.addProperty("email",s1);
request.addProperty("password",s2);
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.setOutputSoapObject(request);
envelope.dotNet = true;
try {
HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
androidHttpTransport.call(SOAP_ACTION, envelope);
SoapObject result = (SoapObject)envelope.bodyIn;
if(result != null){
et_unm.setText(result.getProperty(0).toString());
} else
Toast.makeText(getApplicationContext(), "No Response",Toast.LENGTH_LONG).show();
}catch (Exception e){
Log.v("LOGIN::","Exception--->"+e.toString());
e.printStackTrace();
}
}
};
myThread.start();