Menu

Problem with Base64

2004-08-06
2004-08-09
  • Sven Grünbacher

    I use only the XmlRpc Server, as Client i use the JAVA from Marquee(http://xmlrpc.sourceforge.net/).
    When i send Raw Data in Base64 decoded, the Java Client brings always an Error "Error decoding BASE64 element: Miscalculated data length.".

    So my Problem ist the Decoding in C++ or the Encoding
    in Java bad.
    Where i can find about the Decoing/Encoding algorithmus?

    Thanks
    Sven

     
    • Sven Grünbacher

      I've found the problem:

      in the Base64.java the function decode(),
      there will be calculate the array length

              int len = ( ( data.length + 3 ) / 4 ) * 3;
      But the C++ Server send the byte Code with /r/n
      <base64>iVBORw0KG.....
      AAlwSFlzAAA......
      zQgJGomhIc.....
      u93uOLMXq.....
      </param></params></methodResponse>

      The /r will be ignored but the /n (new Line) makes trouble in the decode routine from Base64.

      So i fix it for me, but i don't know how say's the specifaction to the transmit of Base64 Raw data.

      mfg.
      Sven Grnbacher

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.