cancel
Showing results for 
Search instead for 
Did you mean: 

Base64 encoded source child element contains XML payload which needs to map target structure - HELP

05-04-2020 6:06 PM
Khalil Explorer
1317 views 2 comments
0 Likes
SAP Managed Tags
Subscribe

Hi All, I will get a SOAP response, and one of the child elements is having Base64 encoded XML payload so I can able to convert to XML but how to map the target structure now. Note: Base64 encoded XML and target structure are the same.

Ex: Input structure:

<?xml version="1.0" encoding="UTF-8"?>
<ns0:invoice_downloadResponse xmlns:ns0="urn:test.com">
   <return>
      <status>OK</status>
      <attachments>
         <item>
            <filename>test</filename>
            <file>PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4gDQo8bm90ZT4gIA0KICA8dG8+VG92ZTwvdG8+ICANCiAgPGZyb20+SmFuaTwvZnJvbT4gIA0KICA8aGVhZGluZz5SZW1pbmRlcjwvaGVhZGluZz4gIA0KICA8Ym9keT5Eb24ndCBmb3JnZXQgbWUgdGhpcyB3ZWVrZW5kITwvYm9keT4gIA0KPC9ub3RlPiAg</file>
            <attachment_type>XML</attachment_type>
         </item>
      </attachments>
   </return>
</ns0:invoice_downloadResponse>

Output structure:

<?xml version="1.0" encoding="UTF-8"?> 
<note> 
  <to></to> 
  <from></from> 
  <heading></heading> 
  <body></body> 
</note> 

Using UDF I can able to convert the File field value of XML payload but how to map to target structure since its same.

This is 1st Message Mapping, 2nd Mapping I need to map the 1st MM target as source and final target structure would be IDOC. Please share your knowledge and help me with this requirement. Thank you!!

0 Likes

Accepted Solutions (0)

Answers (2)

Answers (2)

Khalil
Explorer
0 Likes

Hi Evgeniy, Sorry for the late reply. I was not well a few days.

Do you have any java code? could you please help me? any reference code.

Thank you.

former_member190293
Active Contributor
0 Likes

Hi!

Use java mapping at first step to decode Base64 string to XML structure and send it as output payload.

Regards, Evgeniy.