0

I am using ksoap2 library in android for implementing soap webservices. Now this works well when the data to be downloaded is small (few kb/mb's). But when the response is large it gives me OutOfMemoryError after the below loc,

HttpTransportSE.call(ACTION,SoapSerializationEnvelope);

I know that this is caused due to low heap space. I have read same post here.

But there may be some other way instead of customizing the HttpTransportSE class itself (In ref to above link ).

below is the ss: enter image description here

Community
  • 1
  • 1
krohit
  • 792
  • 1
  • 7
  • 26

1 Answers1

0

Two strategies to help you solve this problem:

-Save your SOAP XML stream directly to disk as you download it. Don't store it in memory.

-Parse it using a SAX-style parser, where you don't load the whole DOM in memory, but rather parse it in chunks.

Born To Win
  • 3,319
  • 3
  • 19
  • 27
  • Thanks for your reply. Can you pls provide information on how to save SOAP xml to disk rather memory. – krohit Aug 13 '14 at 14:15
  • My other issue is: 1) Can I get SOAP response xml before `HttpTransportSE.call(ACTION,SoapSerializationEnvelope);`. 2)Storing soap xml response in disk .. does ksoap2 allows the same (to not store response in memory)? – krohit Aug 13 '14 at 14:19