File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Axis Base64.encode Out of Memory Error.

 
Charles Ben
Greenhorn
Posts: 8
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

Any suggestions or better way to do this and prevent OOM error ..?


 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 8
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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


Any sample code to prevent this error?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic