cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Decode Binary from xml data

0 Likes
2,355

Hello,

I try to get an xml node receiving from an Odata, below is the structure

I would like to get this specific node, then transform it in xml structure.

I use in a content modifier the different properties from the blog

https://blogs.sap.com/2015/04/30/base64decodeconverter-base64-decoding-made-easy/

But infortunatly I can't transform the binary data into xml data

Do you have an idea, do I forget some property into the content modifier in order to transform properly the data ?

Thanks for your help and your answers.

Regards

Accepted Solutions (0)

Answers (3)

Answers (3)

MortenWittrock
SAP Mentor
SAP Mentor

Hi Pascal

As manoj.khavatkopp points out, you can accomplish this easily using only the built-in steps. You need a Filter step to extract the Base64 encoded content and then a Base64 Decoder step. So like this:

After the first step, the payload consists of the Base64 encoded XML. After the second step, the payload is the decoded XML. This is assuming, of course, that the Base64 encoded stuff is actually XML. You refer to it as binary, but XML is text, right.

Configure the Filter step like this:

Have fun with CPI!

Regards,

Morten

manoj_khavatkopp
Active Contributor

Hi Pascal ,

You can achieve this using standard steps provided by CPI :

Your Data --->Filter-->Base64Decoder

In Filter:

Xpath : //Binary

Value Type: String.

Thanks,

Manoj

0 Likes

Hello manoj.khavatkopp and Morten Wittrock thank you very much for your answers.

The binary node contains an " excel file " received from BydDesign software. We want to get this excel file from ByDesign decode it then get different data inside in order to map them.

I tried your solutions but infortunatly there is no decode of the file.

Do you have any other ideas to solve this ?

Thanks for your answers

Regards

manoj_khavatkopp
Active Contributor
0 Likes

Hi Pascal,

Currently, there is no out of box solution to read/write excel file, however you use format conversion bean to read excel and convert into xml . This has to be used after base64 decoding .

https://blogs.sap.com/2018/09/04/formatconversionbean-arrives-in-cpi/

Thanks,

Manoj