Version 10.1 by eMagiz on 2022/06/09 13:06

Show last authors
1 {{html wiki="true"}}
2 <div class="ez-academy">
3 <div class="ez-academy_body">
4
5 <div class="doc">
6
7
8
9 = Base64 encoding =
10
11 Most of the time, you can use the standard tooling of eMagiz to manipulate the data so that it makes sense for the (external) party that receives the data. However, sometimes there are cases in which you need a little bit of extra complexity. This microlearning will explain one of those more complex scenarios. In this microlearning, we will learn how to use base64 encoding on your (input) message. This functionality is beneficial when the message is not encoded, but you need to send the data encoded to the external party.
12
13 Should you have any questions, please get in touch with academy@emagiz.com.
14
15 * Last update: August 26th, 2021
16 * Required reading time: 5 minutes
17
18 == 1. Prerequisites ==
19
20 * Basic knowledge of the eMagiz platform
21
22 == 2. Key concepts ==
23
24 This microlearning centers around base64 encoding.
25 We mean turning the string into an encoded string that the external party can handle.
26
27 Essential characteristics of this functionality are:
28
29 * Encoding (and decoding) of base64 strings take up additional memory (up to 33%)
30 * Separate integration for the base64 strings apart from metadata is advisable
31 * The component in eMagiz needs a base64 encoded string as input
32 * Multiple times encoding and encoding in the same integration is **not** advisable
33
34
35
36 == 3. Base64 encoding ==
37
38 Most of the time, you can use the standard tooling of eMagiz to manipulate the data so that it makes sense for the (external) party that receives the data. However, sometimes there are cases in which you need a little bit of extra complexity. This microlearning will explain one of those more complex scenarios. In this microlearning, we will learn how to use base64 encoding on your (input) message. This functionality is beneficial when the message is not encoded, but you need to send the data encoded to the external party.
39
40 Essential characteristics of this functionality are:
41
42 * Encoding (and decoding) of base64 strings take up additional memory (up to 33%)
43 * Separate integration for the base64 strings apart from metadata is advisable
44 * The component in eMagiz needs a base64 encoded string as input
45 * Multiple times encoding and encoding in the same integration is **not** advisable
46
47 The Base64 encode algorithm converts the original string into a base64 encoded string. Technically, it can be said that it converts eight-bit bytes into six-bit bytes. So when you have a string of ABC, you could manually convert this to an encoded format. You can find an excellent explanation of how it works [here](https://base64.guru/learn/base64-algorithm/encode). Luckily for us, eMagiz will do all the heavy lifting, and we do not have to take out pen and paper.
48
49 In the remainder of this microlearning, we will look at how you could implement this logic within the eMagiz tooling.
50
51 === 3.1 Implementation ===
52
53 To implement this logic, we need to add a separate component to our flow at the point where we want to encode the base64 string. This is generally part of your processing. The most logical place would be a flow associated with processing (i.e., offramp, exit gate, event processor).
54
55 First, we need to navigate to the Create phase of eMagiz and open the flow in which we want to add this logic. Once you have opened your flow, you need to enter "Start editing" mode. This mode allows you to change the flow in question and add the logic to the transformation within the flow. When you have done so, it becomes time to add the base64 encode component to the flow.
56
57 <p align="center">[[image:intermediate-data-handling-base64-encode--component.png||]]</p>
58
59 At the component level, you need to define the input and output channel. Note that when the charset of the input message deviates from the UTF-8 default, you should specify the charset on the Advanced tab.
60
61 === 3.2 Use cases ===
62
63 Now that we know how to implement it, we can quickly look at possible use cases for this logic. We see this logic popping up mainly when dealing with attachments/files (i.e., pictures, pdf) within XML messages.
64
65 ===== Practice =====
66
67 == 4. Assignment ==
68
69 Look for places where you could use this logic to aid your integration process within your (Academy) project.
70 This assignment can be completed with the help of your (Academy) project you have created/used in the previous assignment.
71
72 == 5. Key takeaways ==
73
74 Essential characteristics of this functionality are:
75
76 * Encoding (and decoding) of base64 strings take up additional memory (up to 33%)
77 * Separate integration for the base64 strings apart from metadata is advisable
78 * The component in eMagiz needs a base64 encoded string as input
79 * Multiple times encoding and encoding in the same integration is **not** advisable
80
81
82
83 == 6. Suggested Additional Readings ==
84
85 If you are interested in this topic and want more information, please read the help text provided by eMagiz and the following links:
86
87 * https://base64.guru/learn/base64-algorithm/encode
88 * https://www.base64encode.org/
89
90 == 7. Silent demonstration video ==
91
92 This video demonstrates how you could have handled the assignment and gives you some context on what you have just learned.
93
94 <iframe width="1280" height="720" src="../../vid/microlearning/intermediate-data-handling-base64-encode.mp4" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
95
96 </div>
97
98 </div>
99 </div>
100
101 {{/html}}