0
我使用SOAP網絡服務的Android和它應該返回字符串數組,但我在檢索數組或數組元素肥皂字符串返回數組到Android
面臨着一些問題,但我有一些其他的整數數組並且工作正常!
try {
SoapObject request5 = new SoapObject(NAMESPACE5, METHOD_NAME5);
HttpTransportSE androidHttpTransport5 = new HttpTransportSE(URL5);
PropertyInfo pi = new PropertyInfo();
pi.setName("TID");
pi.setValue(TID);
pi.setType(Integer.class);
request5.addProperty(pi);
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
SoapEnvelope.VER11);
envelope.setOutputSoapObject(request5);
androidHttpTransport5.call(SOAP_ACTION5, envelope);
// HERE IS THE PROBLEM
Object result= envelope.getResponse();
String str = null;
for (int i = 0; i < (result).getPropertyCount(); i++) {
str = ((String) (result).getProperty(i).toString());
StudentIdList.add(get(str));
}
p.setids(StudentIdList);
} catch (SocketTimeoutException e) {
p.seterror("error");
return p;
}
catch (ConnectTimeoutException e) {
p.seterror("error");
return p;
} catch (Exception e) {
p.seterror(e.toString());
return p;
}
日誌:
The method getProperty(int) is undefined for the type Object