Axis Base64.encode Out of Memory Error.

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.

Hi!
You are not saying what kind of way your client uses to assemble SOAP messages for the web service.
If you are using SAAJ, have you considered or tried to use the SOAPMessage.createAttachmentPart method that takes a DataHandler as parameter?
The DataHandler, in turn, is created with a DataSource as parameter and the DataSource instance is a FileDataSource.
Best wishes!

Charles Ben
Greenhorn

Joined: Jun 02, 2009
Posts: 8

posted Dec 10, 2009 05:51:02

0

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