我正在尝试使用 Web 服务显示数据。代码没有给出错误,但是在按钮单击时,执行只发生在尝试部分,除此之外没有任何执行
try {
Toast.makeText(getApplicationContext(), "You r in try", Toast.LENGTH_LONG).show();
HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
//this is the actual part that will call the webservice
androidHttpTransport.call(SOAP_ACTION1, envelope);
// Get the SoapResult from the envelope body.
SoapObject result = (SoapObject)envelope.bodyIn;
//from here nothing executes but gives no error
****if(result != null**)
{
Toast.makeText(getApplicationContext(), "You r in if", Toast.LENGTH_LONG).show();
//Get the first property and change the label text
tv1.setText(result.getProperty(0).toString());
}
else
{
Toast.makeText(getApplicationContext(), "No Response",Toast.LENGTH_LONG).show();
}
} catch (Exception e) {
e.printStackTrace();
}
}
});