Skip to Content
avatar image
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 comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    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

    Add comment
    10|10000 characters needed characters exceeded