• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Axis Base64.encode Out of Memory Error.

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ..?


 
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
reply
    Bookmark Topic Watch Topic
  • New Topic