• 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

IGNORE THE PREVIOUS BASE64 QUESTION!

 
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi guys,
Its been a while since i've used these pages, I hope its as good as when I last used them.....
Here's the problem: I am using the following class org.apache.soap.encoding.soapenc.Base64 provided by Apache to do my encoding and decoding. I need to Base64 encode some data as i am then passing it to a SOAP server wrapped in XML. All seems cool, right? Wrong. The code below shows the following steps
1) create Base64 class;
2) read a file on the filesystem into a Byte[] (using a FileInputStream)
3) call the encode method in the Base64 class, passing the byte[];
4) the SOAP function then decodes the data, encrypts it, re-encodes it and then sends it back wrapped in XML
The problem is this, when the SOAP function receives the encoded data it cannot decode for some reason, fails and creates a zero byte file!! I have used a n other 3rd party (online: http://david.carter-tod.com/base64/ ) base64 encoder, encoded some text, put that into file, then repeated the steps above (obviously missing out the encode step) and all worked fine!!!
So, my conclusion is that the base64 encoder I am using is encoding incorrectly. Incorrectly for the SOAP side of things anyway.
My code is below, any thoughts?
I have used 4 different Base64 Encoder classes and all have the same result!
reply
    Bookmark Topic Watch Topic
  • New Topic