Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

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



Former Member

I think you are trying to use Sun's Base64 decoder, which should be avoided - refer to my comments in Base64 Encoding using UDF

Try using my code which uses class javax.xml.bind.DatatypeConverter. You will need to add this class in the import instructions of the Message Mapping.

You should also try testing the UDF directly in the mapping area using Display Queue (as shown in my screenshot above), that will be faster to test rather than performing end to end testing.

1 View this answer in context
Not what you were looking for? View more on this topic or Ask a question