Question

I am sending multiple PDF files through SOAP which will be received by an Android client. But when receiving the SOAP response, it is throwing OutOfMemoryException.

I want to know whether its a limitation of kSOAP or Android. Please guide me how to overcome it.

Thanks.

Was it helpful?

Solution

I would suggest to not do that. Just put the raw url to the pdf file into the soap message and download the pdf separately independent of soap. That works great for me with PDF files as well as images..

So in a bit more detail:

One of your results from the SOAP request should contain a full public url to the PDF file somewhere on the internet.

Then use DownloadManager or whatever you want in terms of Android development to get the file downloaded by using the url you got from the soap response. But dont have the PDF wrapped within the soap request. That way you can also show a progress bar during download and so on nicely. Downloading files on Android is documented everywhere..

OTHER TIPS

I now that this is old question but maybe I help other developers. The most efficient way to sending a large binary content from/to web service is MTOM transfer (SOAP with attachments). The problem is that ksoap2 library doesn't support this feature, but you can try http://easywsdl.com generator. What I know is that it supports MTOM transfer and allows you to send/retrieve very large binary files. Of course MTOM transfer has to be enabled also on the web service side.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top