在我的项目中,我正在调用一个 Web 服务,该服务将响应作为来自 SQL 服务器的数千条记录返回,但由于 SOAP ENVELOPE 的默认大小为 64KB,我在我的 log-cat 和OutOfMemory
异常中只获得前 15 条记录...
请告诉我如何在 SD 卡中的 xml 文件中写入此响应。
private static String SOAP_ACTION1 ="http://tempuri.org/DownloadAllMasterDataRelatedToFarmer";
private static String NAMESPACE = "http://tempuri.org/";
private static String METHOD_NAME1 = "DownloadAllMasterDataRelatedToFarmer";
private static String URL = "http://someIP/Tracebaledemo/fieldbook/webservice1.asmxwsdl";
(...)
SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME1);
request.addProperty("prefixText",txtFar.getText().toString());
request.addProperty("count",txtCount.getText().toString());
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.setOutputSoapObject(request);
envelope.dotNet = true;
try {
HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
Log.d(TAG, "Entering Try and calling WebService");
//this is the actual part that will call the webservice
androidHttpTransport.call(SOAP_ACTION1, envelope);
// Get the SoapResult from the envelope body.
Log.d(TAG, "Fetching Results");
SoapObject result = (SoapObject)envelope.bodyIn;
Log.d(TAG, "Result from WebService before if block= "+result);
} (...)