Skip to Content
author's profile photo Former Member
Former Member

Field Level Base 64 Decoding


We are trying to use the Custom Adapter Module as per the blog by Former Member wherein we are trying to decode a field level Base64 encoded file.

Scenario - Encoded XML File - to - Decoded XML File

PO Version - 7.5

Issue - Consider there are 4 fields in an XML file wherein the 3rd field is coming BASE64 encoded. Now in the output I need an XML format wherein I am trying to capture all the 4 fields and the 3rd field should be decoded.

I am using the below configuration in the Module Parameter of Sender Channel:

Now when I am doing an end to end test. The file is getting picked up and but I am getting an error during processing:

And strange part is when I check the payload, only the XPATH mentioned field is getting generated with the decoded value and the REST OF THE FILEDS ARE NOT GETTING POPULATED AT ALL. Also I am not getting the output in the XML format in the message monitoring view. Is it something I am missing in here where in anyone could help us out?

Referred Links :

FormatConversionBean - One Bean to rule them all!

Base64DecodeConverter - Base64 decoding made easy!

The Mystery of 'Content is not allowed in prolog'

SAX Error – Content is not allowed in prolog



Error Log.jpg (105.5 kB)
Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    Posted on Mar 09, 2016 at 01:52 AM

    Hi Nitin

    The custom module was designed to decode one field and replace the whole payload with that field's decoded content. It does not preserve the other contents in the XML structure. The reason it is failing with "Content not allowed in prolog" is because it is no longer an XML structure, but the mapping step was still trying to parse it as an XML payload.

    If you want to just decode one particular field while preserving the other fields, you do not need to use the module. This can be achieve using a UDF in a message mapping.


    Eng Swee

    udf.png (15.1 kB)
    test.png (24.6 kB)
    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.