感觉应该是加粗的那几行出错了
private List<String> getdata() {
List<String> data = new ArrayList<String>();
// 调用的方法
String methodName = "DatasLoadedNote";
// 创建HttpTransportSE传输对象
HttpTransportSE ht = new HttpTransportSE(SERVICE_URL);
ht.debug = true;
// 使用SOAP1.1协议创建Envelop对象
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
SoapEnvelope.VER11);
// 实例化SoapObject对象
SoapObject soapObject = new SoapObject(SERVICE_NS, methodName);
soapObject.addProperty("Uname", "wang");
// 将soapObject对象设置为 SoapSerializationEnvelope对象的传出SOAP消息
envelope.bodyOut = soapObject;
envelope.dotNet = true;
try {
// 调用Web Service
ht.call(SERVICE_NS + methodName, envelope);
if (envelope.getResponse() != null) {
// 获取服务器响应返回的SOAP消息
SoapObject result = (SoapObject) envelope.bodyIn;
// 接下来就是从SoapObject对象中解析响应数据的过程了。
SoapObject detail1 = (SoapObject) result.getProperty(0);
SoapObject detail2 = (SoapObject) detail1.getProperty(1);
detail3 = (SoapObject) detail2.getProperty(0);
// detail4 = (SoapObject) detail3.getProperty(1);
// String result1 = detail4.toString();
}
} catch (Exception e) {
e.printStackTrace();
}
for (int i = 0; i < 2; i++) {
result1 = detail3.getProperty(i).toString();
data.add(result1);
}
return data;
}
result1赋值错误