Axis Base64.encode Out of Memory Error
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Ren_Vij
Posted On:   Thursday, December 10, 2009 11:58 AM

Requirement is to upload more than 600 documents to a server using webservice. And im using axis Base64.encode method to encode the byte[] and before calling the webservice method. Many a times im getting out of memory error at this encoding which i believe is caused when the file size is more than 1 MB. Im converting the byte[] to Base64 Encoded String and convert it back to byte[] for uploading. Im using axis to generate the webservice stubs and the files which are uploaded are created run time. calls to the webservice will look like below. Any suggestions/sample code or better way to do this and prevent OOM error ..? byte[] bytes= generateFile(); String encodedStr= org.apache.axis.encoding.Base64.encode(bytes); byte[] data =    More>>

Requirement is to upload more than 600 documents to a server using webservice. And im using axis Base64.encode method to encode the byte[] and before calling the webservice method. Many a times im getting out of memory error at this encoding which i believe is caused when the file size is more than 1 MB. Im converting the byte[] to Base64 Encoded String and convert it back to byte[] for uploading. Im using axis to generate the webservice stubs and the files which are uploaded are created run time. calls to the webservice will look like below. Any suggestions/sample code or better way to do this and prevent OOM error ..?

			
byte[] bytes= generateFile();
String encodedStr= org.apache.axis.encoding.Base64.encode(bytes);
byte[] data = encodedStr.getBytes();
String status = stub.uploadDoc(byte[]);
   <<Less
About | Sitemap | Contact