In my project I am calling a web-service which giving response back as thousands of records from SQL server but as default size of SOAP ENVELOPE is 64KB I am getting only first 15 records in my log-cat and OutOfMemory
exception...
Please tell me how to write this response in xml file in SD card.
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);
} (...)
You Saving Your xml just to fetch your
records
if it is not necessary You can doWhy Dont you define a limit to your
Activity
or You can also refine your webService And You can use a
Footer
showingLoading more
in this Way you can see your recordsDrawBack- It Will take time to fetch your records as you said u have 10,000 records
Solution- You can refine your webservice By Using 1st Letter of your Search Event I hope u Getting what i am trying to say If no, Please let me know