我正在使用 SOAP Parsing 在 android 中。在我的应用程序中,有一点我必须下载大量数据,其中也存在字节数组类型的数据。
对于解决方案,我参考了链接非常大的 SOAP 响应 - Android - 内存不足错误,但无法了解它如何与我的肥皂对象一起使用。
我用来获取肥皂响应的方法如下:
public SoapObject taskDetail() {
SoapObject result = null;
SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
request.addProperty("ID", "4");
request.addProperty("fromDate", "02/06/2013");
request.addProperty("toDate", "02/06/2013");
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.dotNet = true;
envelope.setOutputSoapObject(request);
AndroidHttpTransport transport = new AndroidHttpTransport(URL);
transport.debug = true;
try {
transport.call(SOAP_ACTION, envelope);
result = (SoapObject)envelope.getResponse();
for(int i=0; i<result.getPropertyCount(); i++) {
SoapObject view_task_master = (SoapObject) result.getProperty(i);
screen = view_task_master.getProperty("Screen").toString();
Log.i("screen",screen);
date = view_task_master.getProperty("Createddate").toString();
Log.i("date",date);
}
}
catch (IOException e) {
Log.i("IOException",e.getMessage());
}
catch (XmlPullParserException e) {
Log.i("XMLPullParserException",e.getMessage());
}
return result;
}
我知道主要问题是由于数据量大,结果对象无法处理它。
请帮助...提前谢谢...!!