<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Unmarshalling and Marshalling &#8211; GLU Global</title>
	<atom:link href="https://glu.global/article-categories/unmarshalling-and-marshalling/feed/" rel="self" type="application/rss+xml" />
	<link>https://glu.global</link>
	<description>Innovation at Speed</description>
	<lastBuildDate>Fri, 25 Oct 2024 11:54:35 +0000</lastBuildDate>
	<language>en-GB</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	

<image>
	<url>https://glu.global/wp-content/uploads/2022/01/cropped-favicon-1-32x32.png</url>
	<title>Unmarshalling and Marshalling &#8211; GLU Global</title>
	<link>https://glu.global</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>XML Unmarshalling</title>
		<link>https://glu.global/glu-guide/xml-unmarshalling/</link>
		
		<dc:creator><![CDATA[Carol Whyte]]></dc:creator>
		<pubDate>Mon, 30 Jan 2023 14:48:28 +0000</pubDate>
				<guid isPermaLink="false">https://glu.global/?post_type=ht_kb&#038;p=3824</guid>

					<description><![CDATA[The GLU process for unmarshaling XML involves converting the XML data into JSON format, followed by the unmarshaling of the JSON. If the connector request calls for XML, the JSON data is then converted back to XML. Example payload to UnMarshall You can copy the XML body into a JSON Converter to make it more [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p>The GLU process for unmarshaling XML involves converting the XML data into JSON format, followed by the unmarshaling of the JSON. If the connector request calls for XML, the JSON data is then converted back to XML.<br><br></p>



<h2 class="wp-block-heading has-medium-font-size"><strong>Example payload to UnMarshall</strong><br><br></h2>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img fetchpriority="high" decoding="async" width="852" height="462" src="https://glu.global/wp-content/uploads/2023/02/image-177.png" alt="" class="wp-image-5642" srcset="https://glu.global/wp-content/uploads/2023/02/image-177.png 852w, https://glu.global/wp-content/uploads/2023/02/image-177-300x163.png 300w, https://glu.global/wp-content/uploads/2023/02/image-177-768x416.png 768w, https://glu.global/wp-content/uploads/2023/02/image-177-50x27.png 50w" sizes="(max-width: 852px) 100vw, 852px" /></figure></div>


<p><br><br>You can copy the XML body into a JSON Converter to make it more readable:  <br><a rel="noreferrer noopener" href="https://codebeautify.org/xmltojson#" target="_blank">Code Beautify</a><br><br></p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img decoding="async" width="532" height="571" src="https://glu.global/wp-content/uploads/2023/02/Screenshot-2023-02-07-at-09.10.51.png" alt="" class="wp-image-4902" srcset="https://glu.global/wp-content/uploads/2023/02/Screenshot-2023-02-07-at-09.10.51.png 532w, https://glu.global/wp-content/uploads/2023/02/Screenshot-2023-02-07-at-09.10.51-280x300.png 280w, https://glu.global/wp-content/uploads/2023/02/Screenshot-2023-02-07-at-09.10.51-47x50.png 47w" sizes="(max-width: 532px) 100vw, 532px" /></figure></div>


<p><br>GLU needs to be told where the parameters are, so you need to read into the XML body for the parameter location.</p>



<p><br><strong>Examples</strong></p>



<p>First define the parameter name.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full is-resized"><img decoding="async" width="469" height="529" src="https://glu.global/wp-content/uploads/2023/02/image-181.png" alt="" class="wp-image-5647" style="width:440px" srcset="https://glu.global/wp-content/uploads/2023/02/image-181.png 469w, https://glu.global/wp-content/uploads/2023/02/image-181-266x300.png 266w, https://glu.global/wp-content/uploads/2023/02/image-181-44x50.png 44w" sizes="(max-width: 469px) 100vw, 469px" /></figure></div>


<p><br></p>



<p><br>In the Unmarshalling section, the attribute name to unmarshal from is specified within the attributes section, with the unmarshalling operation originating from the Body of the SOAP message. Specifically, for the parameter <code>offlineMode</code>, its path within the SOAP message is delineated as follows:</p>



<p></p>



<ul class="wp-block-list">
<li><strong>Parameter Name:</strong> <code>offlineMode</code></li>



<li><strong>Path:</strong> <code>soap:Envelope.soap:Body.ns1:datadictionaryResponse.return</code></li>
</ul>



<p><br>This configuration indicates that the <code><strong><em>offlineMode</em></strong></code> parameter is located within the SOAP message&#8217;s Body, specifically under the <code><strong><em>datadictionaryResponse.return</em></strong></code> node. The <code><strong><em>attributes</em></strong></code> section would define additional details related to unmarshalling, such as the attribute&#8217;s name within the SOAP message structure.<br><br></p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="567" height="814" src="https://glu.global/wp-content/uploads/2023/02/image-182.png" alt="" class="wp-image-5648" srcset="https://glu.global/wp-content/uploads/2023/02/image-182.png 567w, https://glu.global/wp-content/uploads/2023/02/image-182-209x300.png 209w, https://glu.global/wp-content/uploads/2023/02/image-182-35x50.png 35w" sizes="auto, (max-width: 567px) 100vw, 567px" /></figure></div>


<p><br></p>



<p>In the Object / Collection Path field, you would specify the path to access the attribute within the SOAP message. For the <code><em><strong>offlineMode</strong></em></code> parameter, this path is:</p>



<p></p>



<figure class="wp-block-table"><table><tbody><tr><td><em>kotlinCopy code<code>soap:Envelope.soap:Body.ns1:datadictionaryResponse.return<br></code>Save to grepper</em></td></tr></tbody></table></figure>



<pre class="wp-block-preformatted"></pre>



<p></p>



<p></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Unmarshalling an Array or a Class to Store it as an Object</title>
		<link>https://glu.global/glu-guide/unmarshalling-an-array-or-a-class-to-store-it-as-an-object/</link>
		
		<dc:creator><![CDATA[Carol Whyte]]></dc:creator>
		<pubDate>Mon, 30 Jan 2023 14:45:19 +0000</pubDate>
				<guid isPermaLink="false">https://glu.global/?post_type=ht_kb&#038;p=3822</guid>

					<description><![CDATA[If you have a payload with classes where you are only interested in the class as a whole with all its underlying attributes, i.e. you have no interest in what those underlying attributes are, you can utilise the &#8216;Store as Object&#8217; option when unmarshalling your payload. When you select this option, the Attribute Name box [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p></p>



<p>If you have a payload with classes where you are only interested in the class as a whole with all its underlying attributes, i.e. you have no interest in what those underlying attributes are, you can utilise the <strong><em>&#8216;Store as Object&#8217;</em></strong> option when unmarshalling your payload. When you select this option, the Attribute Name box will disappear, as you are not dealing with an attribute but with the full object. Instead, you can define a name for your object in the &#8216;Object / Collection&#8217; path. Here&#8217;s an example:</p>



<p></p>



<p></p>


<div class="wp-block-image">
<figure class="aligncenter size-full is-resized"><img loading="lazy" decoding="async" width="536" height="561" src="https://glu.global/wp-content/uploads/2023/02/image-63.png" alt="" class="wp-image-5421" style="width:402px;height:421px" srcset="https://glu.global/wp-content/uploads/2023/02/image-63.png 536w, https://glu.global/wp-content/uploads/2023/02/image-63-287x300.png 287w, https://glu.global/wp-content/uploads/2023/02/image-63-48x50.png 48w" sizes="auto, (max-width: 536px) 100vw, 536px" /></figure></div>


<p></p>



<p>If the object is nested within an array(s) or a class(es), you can set your Object / Collection Path to reference the full path to the object you are interested in. Here are examples:</p>



<p></p>



<ol class="wp-block-list">
<li><strong>For an array:</strong></li>
</ol>



<figure class="wp-block-table"><table><tbody><tr><td><em>ParentArrayName1[].SubArrayName1[].ObjectName</em></td></tr></tbody></table></figure>



<pre class="wp-block-code"><code></code></pre>



<ol class="wp-block-list" start="2">
<li><strong>For a class:</strong></li>
</ol>



<p></p>



<figure class="wp-block-table"><table><tbody><tr><td><em>class1.class2.ObjectName</em></td></tr></tbody></table></figure>



<pre class="wp-block-code"><code></code></pre>



<p><strong>Classes, Objects and Arrays &#8211; the basics</strong></p>



<p>Arrays and Objects are two data structures used in API Request and Response messages to organize data:<br></p>



<ul class="wp-block-list">
<li><strong>Array:</strong> Is a collection of similar data items stored in a single variable. Each item in the array has an index number that starts from 0, and you can access each item by its index number. For example, an array of numbers could be [1, 2, 3, 4, 5].</li>



<li><strong>Object:</strong> Is a collection of key-value pairs where each key is a string and each value can be of any data type (numbers, strings, arrays, objects, etc.). You can access the values in an object by their keys. For example, an object could be: { &#8220;name&#8221;: &#8220;John&#8221;, &#8220;age&#8221;: 30, &#8220;city&#8221;: &#8220;New York&#8221; }<br></li>
</ul>



<p>In the context of API Request and Response messages, Arrays and Objects can be used to structure data that is being sent or received, making it easier to access and manage.</p>



<p><br><br>An Object and a Class are related concepts in object-oriented programming (OOP), but they are not the same thing.<br></p>



<p><br>A Class is a blueprint or a template for creating objects. It defines the properties and methods that the objects created from that class will have. Classes are typically used to model real-world objects, and each object created from the class represents an instance of that class.<br></p>



<p><br>An Object, on the other hand, is an instance of a class. It has the properties and methods defined by the class, and can be used to store and manipulate data. An object is created from a class by calling the constructor of the class.<br></p>



<p><br>So, to summarize, a Class is a definition of a type of object, while an Object is an instance of that type of object.</p>



<p><br>Here&#8217;s an example in JSON API Response message that represents a list of books:</p>



<p></p>



<figure class="wp-block-table"><table><tbody><tr><td><em>api_response = {<br>&#8220;books&#8221;: [<br>{<br>&#8220;title&#8221;: &#8220;The Great Gatsby&#8221;,<br>&#8220;author&#8221;: &#8220;F. Scott Fitzgerald&#8221;,<br>&#8220;year&#8221;: 1925<br>},<br>{<br>&#8220;title&#8221;: &#8220;To Kill a Mockingbird&#8221;,<br>&#8220;author&#8221;: &#8220;Harper Lee&#8221;,<br>&#8220;year&#8221;: 1960<br>}<br>]<br>}</em></td></tr></tbody></table></figure>



<p></p>



<p>In this example, <code><strong><em>Book</em></strong></code> is a Class that defines a type of object representing a book. It has three properties <code><strong><em>title</em></strong></code>,<strong><em> <code>author</code></em></strong>, and <code><strong><em>year</em></strong></code>.</p>



<p></p>



<p>The API Response message is a JSON object that has an array of books, each represented by an object with properties <code><strong><em>title</em></strong></code>, <code>author</code>, and <code>year</code>. The code loops through the array of books in the API response and creates instances of the <code>Book</code> class for each book, storing them in the <code>books</code> list. The code then loops through the <code>books</code> list and prints the properties of each <code>Book</code> object.</p>



<p><br><br><strong>&#8220;Books&#8221;</strong> in the <code><strong><em>api_response</em></strong></code> is an array of objects. Each object in the <strong>&#8220;books&#8221;</strong> array represents a book and has properties <code><strong><em>title</em></strong></code>, <code><strong><em>author</em></strong></code>, and <code><strong><em>year</em></strong></code>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Working with Arrays</title>
		<link>https://glu.global/glu-guide/working-with-arrays/</link>
		
		<dc:creator><![CDATA[Carol Whyte]]></dc:creator>
		<pubDate>Mon, 30 Jan 2023 14:41:03 +0000</pubDate>
				<guid isPermaLink="false">https://glu.global/?post_type=ht_kb&#038;p=3819</guid>

					<description><![CDATA[Marshalling and Unmarshalling in the GLU Engine Marshalling (writing) and unmarshalling (reading) are processes used on both the client/sender side (upstream) and the server/receiver side (downstream) of the GLU engine. Unmarshalling (Reading) When a request enters the GLU engine, it undergoes unmarshalling—the process of transforming the incoming data into the GLU Object Model (typically in [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p><strong>Marshalling and Unmarshalling in the GLU Engine</strong></p>



<p>Marshalling (writing) and unmarshalling (reading) are processes used on both the client/sender side (upstream) and the server/receiver side (downstream) of the GLU engine.</p>



<p><strong>Unmarshalling (Reading)</strong></p>



<p>When a request enters the GLU engine, it undergoes <strong>unmarshalling</strong>—the process of transforming the incoming data into the <strong>GLU Object Model</strong> (typically in JSON format). This process applies to both inbound requests and outbound responses. Unmarshalling can involve:</p>



<p>• Saving the entire array as-is</p>



<p>• Searching for and extracting specific values</p>



<p>• Storing only part of the array’s contents</p>



<p><strong>Note</strong>: For details on how to include arrays in responses, refer to the <strong>Response Manager</strong> documentation and response template guidelines.</p>



<p><strong>Array Unmarshalling Principles</strong></p>



<p>1. We always use the <strong>JSON payload</strong> (incoming or response) for our structure when unmarshalling.</p>



<p>2. The array structure in the <strong>source</strong> must match that of the <strong>target</strong> parameter (i.e., an array cannot be stored in a single parameter).</p>



<p>3. When unmarshalling with a condition:</p>



<p>• If only one array index matches the condition <strong>and</strong> both the condition and attribute are on the same level in the JSON structure, then you can save that value into a single parameter.</p>



<p>• Otherwise, the source and target structures must match, meaning the array structure must be preserved.</p>



<h1 class="wp-block-heading has-medium-font-size">Unmarshalling Array configuration</h1>


<div class="wp-block-image">
<figure class="aligncenter size-full is-resized"><img loading="lazy" decoding="async" width="478" height="742" src="https://glu.global/wp-content/uploads/2023/01/image-174.png" alt="" class="wp-image-7346" style="width:330px;height:auto" srcset="https://glu.global/wp-content/uploads/2023/01/image-174.png 478w, https://glu.global/wp-content/uploads/2023/01/image-174-193x300.png 193w, https://glu.global/wp-content/uploads/2023/01/image-174-32x50.png 32w" sizes="auto, (max-width: 478px) 100vw, 478px" /></figure></div>


<p><em>Attribute name</em>: This is the name of the specific attribute whose value you want to retrieve from the response or request.</p>



<p><em>Object / Collection Path:</em> Regardless of the original content type of the request or response, it is always transformed into a JSON structure (you can view this transformation in the DEBUG logs). The <strong>Object/Collection Path</strong> represents the location of the attribute within this JSON structure. If the attribute is inside an array, this is indicated using [] to show the array elements in the path..</p>



<p><em>Condition</em>: If you only want to retrieve specific records from a response, you can apply a condition to filter the data. This allows you to extract only the values that meet the specified criteria.</p>



<h1 class="wp-block-heading has-medium-font-size">Reading Unmarshalling Logs</h1>



<p><strong>Understanding Logs for Value Retrieval</strong></p>



<p>Reading the logs can be very useful for identifying:</p>



<p>1. The <strong>value</strong> that has been retrieved.</p>



<p>2. The <strong>source</strong>—where the value is being pulled from.</p>



<p>3. The <strong>target</strong>—where the value is being saved, including the class or array details.</p>



<figure class="wp-block-image size-large is-resized"><img loading="lazy" decoding="async" width="1024" height="37" src="https://glu.global/wp-content/uploads/2023/01/image-175-1024x37.png" alt="" class="wp-image-7347" style="width:948px;height:auto" srcset="https://glu.global/wp-content/uploads/2023/01/image-175-1024x37.png 1024w, https://glu.global/wp-content/uploads/2023/01/image-175-300x11.png 300w, https://glu.global/wp-content/uploads/2023/01/image-175-768x28.png 768w, https://glu.global/wp-content/uploads/2023/01/image-175-50x2.png 50w, https://glu.global/wp-content/uploads/2023/01/image-175-1536x55.png 1536w, https://glu.global/wp-content/uploads/2023/01/image-175-2048x74.png 2048w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p>If you encounter an error such as:</p>



<p><strong>“Error Saving Parameter [value] in GLU OBJECT Due &gt;&gt; must be a class or class from array!”</strong></p>



<p>This indicates that the <strong>source</strong> and <strong>target</strong> structures do not match. In most cases, the issue arises because the value should be saved into an array, but is instead being treated as a non-array structure. Ensure that the parameter is correctly saved into an array if needed.</p>



<h1 class="wp-block-heading has-medium-font-size"><strong>Un-marshalling like for like arrays</strong></h1>



<p>If my response from a third party looks like this:</p>



<figure class="wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-1 is-layout-flex wp-block-gallery-is-layout-flex">
<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="582" height="556" data-id="7365" src="https://glu.global/wp-content/uploads/2023/01/Screenshot-2024-10-23-at-07.03.38.png" alt="" class="wp-image-7365" srcset="https://glu.global/wp-content/uploads/2023/01/Screenshot-2024-10-23-at-07.03.38.png 582w, https://glu.global/wp-content/uploads/2023/01/Screenshot-2024-10-23-at-07.03.38-300x287.png 300w, https://glu.global/wp-content/uploads/2023/01/Screenshot-2024-10-23-at-07.03.38-50x48.png 50w" sizes="auto, (max-width: 582px) 100vw, 582px" /></figure>
</figure>



<p>For each parameter in the array, the unmarshalling and parameter properties would be defined as follows:</p>



<p>• <strong>Unmarshalling:</strong> In this step, the <strong>object/collection path</strong> is specified to locate the array (e.g., &#8220;result&#8221;), and the attribute inside each element of the array (e.g., accountID, amount, or balanceType) that needs to be saved into a parameter is identified.</p>



<p>• <strong>Properties:</strong> In this section, the <strong>parameter name</strong> is defined, along with the reference to the object (e.g., the &#8220;result&#8221; array) from which the parameter (e.g., accountID, amount) will be extracted and saved.</p>



<p></p>



<figure class="wp-block-image size-large is-resized"><img loading="lazy" decoding="async" width="1024" height="796" src="https://glu.global/wp-content/uploads/2023/02/image-126-1024x796.png" alt="" class="wp-image-5529" style="width:768px;height:597px" srcset="https://glu.global/wp-content/uploads/2023/02/image-126-1024x796.png 1024w, https://glu.global/wp-content/uploads/2023/02/image-126-300x233.png 300w, https://glu.global/wp-content/uploads/2023/02/image-126-768x597.png 768w, https://glu.global/wp-content/uploads/2023/02/image-126-50x39.png 50w, https://glu.global/wp-content/uploads/2023/02/image-126.png 1103w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p></p>



<p></p>



<h1 class="wp-block-heading has-medium-font-size"><strong>Unmarshalling from unnamed arrays</strong></h1>



<p>If my response from a third party looked like this:</p>



<figure class="wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-2 is-layout-flex wp-block-gallery-is-layout-flex">
<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="598" height="170" data-id="7367" src="https://glu.global/wp-content/uploads/2023/01/Screenshot-2024-10-23-at-07.23.16.png" alt="" class="wp-image-7367" srcset="https://glu.global/wp-content/uploads/2023/01/Screenshot-2024-10-23-at-07.23.16.png 598w, https://glu.global/wp-content/uploads/2023/01/Screenshot-2024-10-23-at-07.23.16-300x85.png 300w, https://glu.global/wp-content/uploads/2023/01/Screenshot-2024-10-23-at-07.23.16-50x14.png 50w" sizes="auto, (max-width: 598px) 100vw, 598px" /></figure>
</figure>



<p>You can follow the above steps and replace the name of the array with empty square brackets &#8211; as shown in the &#8216;Object / Collection Path&#8217; field below:</p>


<div class="wp-block-image">
<figure class="aligncenter size-full is-resized"><img loading="lazy" decoding="async" width="624" height="869" src="https://glu.global/wp-content/uploads/2023/02/image-127.png" alt="" class="wp-image-5530" style="aspect-ratio:0.7177914110429447;width:440px" srcset="https://glu.global/wp-content/uploads/2023/02/image-127.png 624w, https://glu.global/wp-content/uploads/2023/02/image-127-215x300.png 215w, https://glu.global/wp-content/uploads/2023/02/image-127-36x50.png 36w" sizes="auto, (max-width: 624px) 100vw, 624px" /></figure></div>


<p></p>



<h1 class="wp-block-heading has-medium-font-size"><strong>Marshalling to unnamed arrays</strong></h1>



<p>See example below; the array is nested within an object under the key &#8220;array&#8221;. This means the array is not at the root level but is a property of an object.</p>



<p>• Inside the &#8220;array&#8221;, each object only has one property (attribute) with a corresponding value.</p>



<p>If you want to marshal an array and save it as an unnamed array, you can use the &#8216;Store as Object&#8217; option. This way, the array will be stored as an object (unnamed array). Here&#8217;s an example:</p>



<figure class="wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-3 is-layout-flex wp-block-gallery-is-layout-flex">
<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="610" height="172" data-id="7369" src="https://glu.global/wp-content/uploads/2023/01/Screenshot-2024-10-23-at-07.46.56.png" alt="" class="wp-image-7369" srcset="https://glu.global/wp-content/uploads/2023/01/Screenshot-2024-10-23-at-07.46.56.png 610w, https://glu.global/wp-content/uploads/2023/01/Screenshot-2024-10-23-at-07.46.56-300x85.png 300w, https://glu.global/wp-content/uploads/2023/01/Screenshot-2024-10-23-at-07.46.56-50x14.png 50w" sizes="auto, (max-width: 610px) 100vw, 610px" /></figure>
</figure>



<p>To:</p>



<figure class="wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-4 is-layout-flex wp-block-gallery-is-layout-flex">
<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="658" height="140" data-id="7372" src="https://glu.global/wp-content/uploads/2023/01/Screenshot-2024-10-23-at-07.49.59.png" alt="" class="wp-image-7372" srcset="https://glu.global/wp-content/uploads/2023/01/Screenshot-2024-10-23-at-07.49.59.png 658w, https://glu.global/wp-content/uploads/2023/01/Screenshot-2024-10-23-at-07.49.59-300x64.png 300w, https://glu.global/wp-content/uploads/2023/01/Screenshot-2024-10-23-at-07.49.59-50x11.png 50w" sizes="auto, (max-width: 658px) 100vw, 658px" /></figure>
</figure>



<p></p>



<p></p>


<div class="wp-block-image">
<figure class="aligncenter size-full is-resized"><img loading="lazy" decoding="async" width="632" height="652" src="https://glu.global/wp-content/uploads/2023/02/image-128.png" alt="" class="wp-image-5531" style="width:440px" srcset="https://glu.global/wp-content/uploads/2023/02/image-128.png 632w, https://glu.global/wp-content/uploads/2023/02/image-128-291x300.png 291w, https://glu.global/wp-content/uploads/2023/02/image-128-48x50.png 48w" sizes="auto, (max-width: 632px) 100vw, 632px" /></figure></div>

<div class="wp-block-image">
<figure class="aligncenter size-full is-resized"><img loading="lazy" decoding="async" width="512" height="571" src="https://glu.global/wp-content/uploads/2023/02/image-129.png" alt="" class="wp-image-5532" style="aspect-ratio:0.897196261682243;width:426px;height:auto" srcset="https://glu.global/wp-content/uploads/2023/02/image-129.png 512w, https://glu.global/wp-content/uploads/2023/02/image-129-269x300.png 269w, https://glu.global/wp-content/uploads/2023/02/image-129-45x50.png 45w" sizes="auto, (max-width: 512px) 100vw, 512px" /></figure></div>


<h1 class="wp-block-heading has-medium-font-size"><strong>Unmarshalling/Marshalling array of values</strong></h1>



<p>If the response form third party looks like this:</p>



<figure class="wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-5 is-layout-flex wp-block-gallery-is-layout-flex">
<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="573" height="59" data-id="7375" src="https://glu.global/wp-content/uploads/2023/01/Screenshot-2024-10-23-at-08.14.47.png" alt="" class="wp-image-7375" srcset="https://glu.global/wp-content/uploads/2023/01/Screenshot-2024-10-23-at-08.14.47.png 573w, https://glu.global/wp-content/uploads/2023/01/Screenshot-2024-10-23-at-08.14.47-300x31.png 300w, https://glu.global/wp-content/uploads/2023/01/Screenshot-2024-10-23-at-08.14.47-50x5.png 50w" sizes="auto, (max-width: 573px) 100vw, 573px" /></figure>
</figure>


<div class="wp-block-image">
<figure class="aligncenter size-large is-resized"><img loading="lazy" decoding="async" width="1024" height="738" src="https://glu.global/wp-content/uploads/2023/02/image-130-1024x738.png" alt="" class="wp-image-5533" style="width:768px;height:554px" srcset="https://glu.global/wp-content/uploads/2023/02/image-130-1024x738.png 1024w, https://glu.global/wp-content/uploads/2023/02/image-130-300x216.png 300w, https://glu.global/wp-content/uploads/2023/02/image-130-768x553.png 768w, https://glu.global/wp-content/uploads/2023/02/image-130-50x36.png 50w, https://glu.global/wp-content/uploads/2023/02/image-130.png 1202w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure></div>


<p>You can follow the above steps, but leave the attributes fields empty to unmarshall or to marshall.</p>



<p></p>



<h1 class="wp-block-heading has-medium-font-size"><strong>Unmarshalling using a condition</strong></h1>



<h2 class="wp-block-heading has-medium-font-size">SCENARIO 1 &#8211; Source Array is a <strong>FLAT ARRAY OF OBJECTS</strong> : </h2>



<p>If my response from a third party looked like this: </p>



<figure class="wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-6 is-layout-flex wp-block-gallery-is-layout-flex">
<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="582" height="556" data-id="7365" src="https://glu.global/wp-content/uploads/2023/01/Screenshot-2024-10-23-at-07.03.38.png" alt="" class="wp-image-7365" srcset="https://glu.global/wp-content/uploads/2023/01/Screenshot-2024-10-23-at-07.03.38.png 582w, https://glu.global/wp-content/uploads/2023/01/Screenshot-2024-10-23-at-07.03.38-300x287.png 300w, https://glu.global/wp-content/uploads/2023/01/Screenshot-2024-10-23-at-07.03.38-50x48.png 50w" sizes="auto, (max-width: 582px) 100vw, 582px" /></figure>
</figure>



<p>If you want to retrieve the balance for<strong> accountID = 0</strong>, you can add a condition to your unmarshalling configuration. This condition will check each record in the array and retrieve the value where the condition is met. Since you expect only one record in the result set to satisfy this condition, you can store the retrieved value in a single parameter.</p>



<p>However, if multiple records meet the condition, you can still store the values in the parameter, but you’ll need to include the object (array) name in the <strong>property object field</strong> to correctly reference the array in your configuration.</p>



<figure class="wp-block-image size-full is-resized"><img loading="lazy" decoding="async" width="452" height="594" src="https://glu.global/wp-content/uploads/2023/01/image-173.png" alt="" class="wp-image-7276" style="width:342px;height:auto" srcset="https://glu.global/wp-content/uploads/2023/01/image-173.png 452w, https://glu.global/wp-content/uploads/2023/01/image-173-228x300.png 228w, https://glu.global/wp-content/uploads/2023/01/image-173-38x50.png 38w" sizes="auto, (max-width: 452px) 100vw, 452px" /></figure>



<h2 class="wp-block-heading has-medium-font-size">SCENARIO 2 &#8211; Source Array is a <strong>NESTED ARRAY OF OBJECTS</strong> :  </h2>



<p>If my response from a third party looked like this &#8211; you can see that the tx Array is NOT a flat set of objects. </p>



<figure class="wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-7 is-layout-flex wp-block-gallery-is-layout-flex">
<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="685" height="819" data-id="7378" src="https://glu.global/wp-content/uploads/2023/01/Screenshot-2024-10-25-at-13.34.02.png" alt="" class="wp-image-7378" srcset="https://glu.global/wp-content/uploads/2023/01/Screenshot-2024-10-25-at-13.34.02.png 685w, https://glu.global/wp-content/uploads/2023/01/Screenshot-2024-10-25-at-13.34.02-251x300.png 251w, https://glu.global/wp-content/uploads/2023/01/Screenshot-2024-10-25-at-13.34.02-42x50.png 42w" sizes="auto, (max-width: 685px) 100vw, 685px" /></figure>
</figure>



<p>If I want to get the details from the tx array where the it is for the Tariff: </p>



<p><strong>Unmarshalling with a condition where the attribute and condition sit at the SAME level in the array</strong>:</p>



<p><em>Unmarshalling path:</em> The path from the top of the json payload defining the position of where the attribute is sitting: e.g. <em>creditVendResp</em>.<em>transactions</em>.tx[]</p>



<p><em>Attribute name</em>: <em>accNo</em></p>



<p><em>Condition</em>: accDesc==&#8217;<em>Tariff Charge</em>&#8216;</p>



<p><strong>Unmarshalling with a condition where the attribute and condition DO NOT sit at the same level in the array</strong>:</p>



<p><em>Unmarshalling path:</em> The path from the top of the json payload defining the position of where the attribute is sitting: e.g. Envelope.Body.creditVendResp.creditVendReceipt.transactions.tx[].amt</p>



<p><em>Attribute name</em>: <em>value</em></p>



<p><em>Condition</em>: tx.accDesc==&#8217;Tariff Charge&#8217;</p>



<p>This tells us that the unmarshalling path and attribute always go down to the level where the attribute sites. If that level differs to where the condition must be executed, you need to update the condition to understand where in the unmarshalling path to find that condition attribute. </p>



<h1 class="wp-block-heading has-medium-font-size"><strong>Unmarshalling only part of the array contents</strong></h1>



<p>In the above example, if you only want to unmarshal the array and save the <strong><em>accountID</em></strong> and amount fields into an array, then you only need to add those two parameters in the response parameters with the correct configuration included for unmarshalling. This will create the new accounts object without the balanceType parameter.</p>



<h1 class="wp-block-heading has-medium-font-size"><strong>Consolidating amounts in an array</strong></h1>



<p>If I received an array with multiple records for one unique identifier (e.g. accountID) and you wanted to return a consolidated / overall balance for each accountID you could use the following function. This function could be executed on a response handler once the array has been unmarshalled into the engine. It is available in&nbsp;<a href="https://glu.global/glu-guide/derived-parameters-functions-and-formulas/" data-type="ht_kb" data-id="3548">GLU Functions &amp; Formulas</a></p>



<p></p>



<p>If you receive an array with multiple records for one unique identifier (e.g., accountID) and you want to return a consolidated/overall balance for each accountID, you can use the following function, available in GLU Functions &amp; Formulas:</p>



<p></p>



<figure class="wp-block-table"><table><tbody><tr><td><em>CONSOLIDATE(${accounts},accountID,amount)</em></td></tr></tbody></table></figure>



<p></p>



<ul class="wp-block-list">
<li><strong>parameter 1 (arrayName)</strong>: the array name where you have unmarshalled your data</li>



<li><strong>parameter 2 (paramNameConsolidateBy)</strong>: consolidate to this identifier</li>



<li><strong>parameter 3 (paramNameToConsolidate)</strong>: the parameter which you want to add up</li>
</ul>



<p>This function would work for an incoming array structured like this:</p>



<figure class="wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-8 is-layout-flex wp-block-gallery-is-layout-flex">
<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="493" height="222" data-id="7380" src="https://glu.global/wp-content/uploads/2023/01/Screenshot-2024-10-25-at-13.38.49.png" alt="" class="wp-image-7380" srcset="https://glu.global/wp-content/uploads/2023/01/Screenshot-2024-10-25-at-13.38.49.png 493w, https://glu.global/wp-content/uploads/2023/01/Screenshot-2024-10-25-at-13.38.49-300x135.png 300w, https://glu.global/wp-content/uploads/2023/01/Screenshot-2024-10-25-at-13.38.49-50x23.png 50w" sizes="auto, (max-width: 493px) 100vw, 493px" /></figure>
</figure>



<p>The output would look like this:</p>



<figure class="wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-9 is-layout-flex wp-block-gallery-is-layout-flex">
<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="518" height="174" data-id="7382" src="https://glu.global/wp-content/uploads/2023/01/Screenshot-2024-10-25-at-13.39.34.png" alt="" class="wp-image-7382" srcset="https://glu.global/wp-content/uploads/2023/01/Screenshot-2024-10-25-at-13.39.34.png 518w, https://glu.global/wp-content/uploads/2023/01/Screenshot-2024-10-25-at-13.39.34-300x101.png 300w, https://glu.global/wp-content/uploads/2023/01/Screenshot-2024-10-25-at-13.39.34-50x17.png 50w" sizes="auto, (max-width: 518px) 100vw, 518px" /></figure>
</figure>



<p><br>1. <strong>Set a Derived Parameter</strong>:</p>



<p>Start by configuring a derived parameter that will hold the value you intend to compute or override later.</p>



<p>2. <strong>Unmarshal Required Parameters</strong>:</p>



<p>In the response parameters, unmarshal the necessary values into an <strong>accounts array</strong>. This will collect all relevant parameters in a structured format, ready for further processing.</p>



<p>3. <strong>Use a ‘None’ Handler in the Response Handler</strong>:</p>



<p>In your response handler, apply a &#8220;none&#8221; handler, which effectively prevents any additional transformations. This step allows you to override the derived parameter directly with the function you’ve specified.</p>



<p>4. <strong>Override the Derived Parameter</strong>:</p>



<p>Finally, use the function in your configuration to set or compute the value of the derived parameter, replacing its initial placeholder.</p>



<p>See the example below:</p>


<div class="wp-block-image">
<figure class="aligncenter size-full is-resized"><img loading="lazy" decoding="async" width="496" height="467" src="https://glu.global/wp-content/uploads/2023/02/image-132.png" alt="" class="wp-image-5535" style="width:372px;height:350px" srcset="https://glu.global/wp-content/uploads/2023/02/image-132.png 496w, https://glu.global/wp-content/uploads/2023/02/image-132-300x282.png 300w, https://glu.global/wp-content/uploads/2023/02/image-132-50x47.png 50w" sizes="auto, (max-width: 496px) 100vw, 496px" /></figure></div>


<p></p>



<h1 class="wp-block-heading has-medium-font-size"><strong>Unmarshalling a specific position in an array</strong></h1>



<p>You can access a specific position in an array by using a shortcut:</p>



<figure class="wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-10 is-layout-flex wp-block-gallery-is-layout-flex">
<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="528" height="174" data-id="7384" src="https://glu.global/wp-content/uploads/2023/01/Screenshot-2024-10-25-at-13.42.12.png" alt="" class="wp-image-7384" srcset="https://glu.global/wp-content/uploads/2023/01/Screenshot-2024-10-25-at-13.42.12.png 528w, https://glu.global/wp-content/uploads/2023/01/Screenshot-2024-10-25-at-13.42.12-300x99.png 300w, https://glu.global/wp-content/uploads/2023/01/Screenshot-2024-10-25-at-13.42.12-50x16.png 50w" sizes="auto, (max-width: 528px) 100vw, 528px" /></figure>
</figure>



<p></p>



<p>In the accounts array, to retrieve the value of the <strong><em>accountID </em></strong>from the first record, you can use the following expression:</p>



<p></p>



<figure class="wp-block-table"><table><tbody><tr><td>$<em>{accounts[0].accountID}</em></td></tr></tbody></table></figure>



<pre class="wp-block-code"><code></code></pre>



<ul class="wp-block-list">
<li><code><strong>accounts</strong></code>: Refers to the array name.</li>



<li><code><strong>[0]</strong></code>: Indicates the position in the array (in this case, the first record).</li>



<li><code><strong>accountID</strong></code>: Specifies the value in the first record that you want to retrieve.</li>
</ul>



<h1 class="wp-block-heading has-medium-font-size">Finding a value of a specific position/attribute in an array</h1>



<p>If you have unmarshalled successfully into an array &#8211; and you want to get one of the values out of the array. </p>



<p>You can create a derived parameter which specifies the detail of what you want to access: ${arrayname[<em>index</em>].<em>attributeName</em>}. This will print the value and make it accessible in the derived parameter.</p>



<p>e.g.  ${filtered[0].ti} &#8211; this will take the ti value out of the filtered array from index position 0.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Unmarshalling Simple Parameters</title>
		<link>https://glu.global/glu-guide/unmarshalling-simple-1-to-1-parameter-mapping/</link>
		
		<dc:creator><![CDATA[Carol Whyte]]></dc:creator>
		<pubDate>Mon, 30 Jan 2023 12:50:52 +0000</pubDate>
				<guid isPermaLink="false">https://glu.global/?post_type=ht_kb&#038;p=3786</guid>

					<description><![CDATA[When inbound Request Parameters need to be received and stored in the GLU Object Model for later use, you must first configure the &#8216;Unmarshalling&#8217; process for these specific Parameters. In the example below: These configurations define the Type, Location (Header/Body/Query), Parameter Value (Parameter Name), and the Type of the Parameter. You should configure these settings [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p></p>



<p>When inbound Request Parameters need to be received and stored in the GLU Object Model for later use, you must first configure the <strong>&#8216;Unmarshalling&#8217;</strong> process for these specific Parameters.<br><br>In the example below:</p>



<ul class="wp-block-list">
<li>the Parameter has a data type of <strong>&#8216;Text&#8217;</strong></li>



<li>the Parameter is passed and received in the <strong>&#8216;Header&#8217;</strong></li>



<li>the <strong>&#8216;Parameter Name&#8217;</strong> for the Parameter is <strong>&#8216;USERNAMER&#8217;</strong></li>
</ul>



<p>These configurations define the Type, Location (Header/Body/Query), Parameter Value (Parameter Name), and the Type of the Parameter. <br><br>You should configure these settings according to your specific:</p>



<ul class="wp-block-list">
<li>Parameter Type</li>



<li>Parameter Location </li>



<li>Parameter Name</li>
</ul>



<p></p>


<div class="wp-block-image">
<figure class="aligncenter size-full is-resized"><img loading="lazy" decoding="async" width="527" height="620" src="https://glu.global/wp-content/uploads/2023/01/image-119.png" alt="" class="wp-image-3788" style="width:440px" srcset="https://glu.global/wp-content/uploads/2023/01/image-119.png 527w, https://glu.global/wp-content/uploads/2023/01/image-119-255x300.png 255w, https://glu.global/wp-content/uploads/2023/01/image-119-43x50.png 43w" sizes="auto, (max-width: 527px) 100vw, 527px" /></figure></div>


<p><br><br>Next, the received Parameter must be saved in the GLU Object Model for later re-use, see example below:</p>



<ul class="wp-block-list">
<li>the Parameter type is <strong>&#8216;Text&#8217;</strong>,</li>



<li>the Parameter name is translated in this example from <strong>&#8216;USERNAME&#8217;</strong> to be saved a <strong>&#8216;userName&#8217;</strong>,</li>
</ul>



<p>This defines how the Parameter is stored in GLU and in this example we have translated the Parameter name from <strong>&#8216;USERNAME&#8217;</strong> to <strong>&#8216;userName&#8217;</strong>.</p>



<p></p>


<div class="wp-block-image">
<figure class="aligncenter size-full is-resized"><img loading="lazy" decoding="async" width="543" height="391" src="https://glu.global/wp-content/uploads/2023/01/image-120.png" alt="" class="wp-image-3791" style="width:440px" srcset="https://glu.global/wp-content/uploads/2023/01/image-120.png 543w, https://glu.global/wp-content/uploads/2023/01/image-120-300x216.png 300w, https://glu.global/wp-content/uploads/2023/01/image-120-50x36.png 50w" sizes="auto, (max-width: 543px) 100vw, 543px" /></figure></div>]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Unmarshalling &#038; Marshalling Concepts</title>
		<link>https://glu.global/glu-guide/unmarshalling-marshalling-concepts/</link>
		
		<dc:creator><![CDATA[Carol Whyte]]></dc:creator>
		<pubDate>Mon, 30 Jan 2023 12:46:08 +0000</pubDate>
				<guid isPermaLink="false">https://glu.global/?post_type=ht_kb&#038;p=3565</guid>

					<description><![CDATA[Marshalling&#160;is the process of transforming the representation of an object to a data format suitable for storage or transmission. It is typically used when data (parameters) must be moved between different parts of a computer program or from one program to another. The opposite of marshalling is, unmarshalling that is the reverse process, where data [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p>Marshalling&nbsp;is the process of transforming the representation of an object to a data format suitable for storage or transmission. It is typically used when data (parameters) must be moved between different parts of a computer program or from one program to another. The opposite of marshalling is, unmarshalling that is the reverse process, where data is converted from a stored or transmitted format back into an object&#8217;s representation.&nbsp;</p>



<p></p>



<p>In the GLU.Engine, all parameters received from external systems must be unmarshalled into a format compatible with the GLU.Engine, known as a GLU object. Later, these parameters can be transformed or utilized for passing on to subsequent receiving systems.</p>



<p></p>



<p><br>Unmarshalling and Marshalling can be used to change the names or formats of parameters between systems and restructure them into or out of Arrays.&nbsp;</p>



<p></p>



<p></p>



<p><br><strong>An important convention</strong> to note is that when marshalling GLU parameters to be sent to external systems, you reference these variables using the format <strong><em>${variableName}</em></strong>. If passing the variable into a header, such as the Context Name or URL, the format <strong><em>${header.variableName}</em></strong> is used. Conversely, when unmarshalling an incoming variable parameter, which doesn&#8217;t yet exist in the GLU.Engine, the variable format is simply <strong><em>{}</em></strong> without the dollar sign <strong><em>($)</em></strong>.</p>



<h1 class="wp-block-heading has-medium-font-size"><strong>Marshalling</strong></h1>



<p>This is when a GLU.Engine converts a GLU parameter object into Receiving System object.</p>



<p><br>In the example below, a Parameter named <strong><em>&#8216;routeDescription&#8217;</em></strong> is being marshalled to the body of the outgoing request. The template for this request (as defined in the parent Request Manager) is:</p>



<p><br><strong>Example:</strong></p>



<p></p>



<figure class="wp-block-table"><table><tbody><tr><td><em> { &#8220;routeDescription&#8221;&nbsp;: &#8220;${routeDescriptionNewName}&#8221; }</em></td></tr></tbody></table></figure>



<p><br>Therefore, <strong><em>&#8216;routeDescription&#8217;</em></strong> is being&nbsp;<strong>marshalled</strong>&nbsp;into <strong><em>&#8216;routeDescriptionNewName&#8217;</em></strong>, to be available in the request body. </p>



<p></p>



<p><strong>Note:</strong> The addition of the <strong><em>&#8216;NewName&#8217;</em></strong> to the parameter name was solely for visualisation purposes, in practice it is common to name both the Parameter name and the marshalled one the same. It is also possible to marshal into the&nbsp;<strong>Header</strong>&nbsp;or the&nbsp;<strong>Query</strong>. </p>



<p></p>



<h2 class="wp-block-heading has-medium-font-size"><strong>Header</strong></h2>



<p>The Header refers to the <strong>&#8216;Context Name&#8217; </strong>of the Request Manager. For example, to route to a variable after the /, you would need to use the .header syntax as follows:</p>



<p></p>



<figure class="wp-block-table"><table><tbody><tr><td>/<em>${header.headerStub}/echo</em></td></tr></tbody></table></figure>



<p></p>



<p></p>


<div class="wp-block-image">
<figure class="aligncenter size-full is-resized"><img loading="lazy" decoding="async" width="492" height="243" src="https://glu.global/wp-content/uploads/2023/01/image-113.png" alt="" class="wp-image-3769" style="width:440px" srcset="https://glu.global/wp-content/uploads/2023/01/image-113.png 492w, https://glu.global/wp-content/uploads/2023/01/image-113-300x148.png 300w, https://glu.global/wp-content/uploads/2023/01/image-113-50x25.png 50w" sizes="auto, (max-width: 492px) 100vw, 492px" /></figure></div>


<p><br>&#8230; and you would Marshal the <strong>&#8216;headerStub&#8217;</strong> attribute to the Header as follows:</p>



<p></p>



<p></p>


<div class="wp-block-image">
<figure class="aligncenter size-full is-resized"><img loading="lazy" decoding="async" width="534" height="387" src="https://glu.global/wp-content/uploads/2023/01/image-114.png" alt="" class="wp-image-3772" style="width:440px" srcset="https://glu.global/wp-content/uploads/2023/01/image-114.png 534w, https://glu.global/wp-content/uploads/2023/01/image-114-300x217.png 300w, https://glu.global/wp-content/uploads/2023/01/image-114-50x36.png 50w" sizes="auto, (max-width: 534px) 100vw, 534px" /></figure></div>


<h2 class="wp-block-heading has-medium-font-size"><br><strong>Query</strong></h2>



<p>The Query refers to the section following the <strong>&#8216;Context Name&#8217;</strong> in the Request Manager. For example, to route to a variable after <em><strong>/stub/echo?appId=test</strong></em> , you would need to marshal it to the Query as below.</p>



<p></p>



<p></p>


<div class="wp-block-image">
<figure class="aligncenter size-full is-resized"><img loading="lazy" decoding="async" width="541" height="380" src="https://glu.global/wp-content/uploads/2023/01/image-115.png" alt="" class="wp-image-3774" style="width:440px" srcset="https://glu.global/wp-content/uploads/2023/01/image-115.png 541w, https://glu.global/wp-content/uploads/2023/01/image-115-300x211.png 300w, https://glu.global/wp-content/uploads/2023/01/image-115-50x35.png 50w" sizes="auto, (max-width: 541px) 100vw, 541px" /></figure></div>


<p><br><strong>Exception:</strong>&nbsp;If you have a variable in the URL (dynamic URL), you need to marshal the value of the query to the header and insert the <strong><em>?key</em></strong> in the URL, for example: </p>



<figure class="wp-block-table"><table><tbody><tr><td><em>/${header.variable}/something?key=${header.queryValueParameter}</em></td></tr></tbody></table></figure>



<h2 class="wp-block-heading has-medium-font-size"><strong><br>Null Or Empty Parameters</strong></h2>



<p></p>



<p><br>On receiving a null or empty values there are options for what GE should do with these values.</p>


<div class="wp-block-image">
<figure class="alignright size-full"><img loading="lazy" decoding="async" width="328" height="127" src="https://glu.global/wp-content/uploads/2023/01/image-116.png" alt="" class="wp-image-3777" srcset="https://glu.global/wp-content/uploads/2023/01/image-116.png 328w, https://glu.global/wp-content/uploads/2023/01/image-116-300x116.png 300w, https://glu.global/wp-content/uploads/2023/01/image-116-50x19.png 50w" sizes="auto, (max-width: 328px) 100vw, 328px" /></figure></div>


<p><br><strong>Definition:</strong><em> &#8217;empty&#8217;</em> &#8211; is when the parameter exists but there is no value e.g. &#8220;value1&#8221;&nbsp;: &#8220;&#8221;</p>



<p><br><strong>Definition:</strong> <em>&#8216;null&#8217;</em> &#8211; is when the parameter does not exist e.g. if expecting to see &#8220;value2&#8221; in a Response body but &#8220;value2&#8221; does not exist.</p>



<p>Parameters can be changed from &#8216;Null&#8217; to &#8216;Empty&#8217; or &#8216;Empty&#8217; to &#8216;Null&#8217; depending on integration requirements.<br>You also have the option to &#8216;Ignore&#8217; Null or Empty Parameters. When this is selected, the parameter will not be sent (as empty or null)- IE similar to <strong>value4</strong> above. This can be set for all parameters in a payload or per parameter in the Marshalling Control Panel.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="645" height="732" src="https://glu.global/wp-content/uploads/2023/01/image-172.png" alt="" class="wp-image-7265" srcset="https://glu.global/wp-content/uploads/2023/01/image-172.png 645w, https://glu.global/wp-content/uploads/2023/01/image-172-264x300.png 264w, https://glu.global/wp-content/uploads/2023/01/image-172-44x50.png 44w" sizes="auto, (max-width: 645px) 100vw, 645px" /></figure></div>


<h2 class="wp-block-heading has-medium-font-size"><strong>Order By</strong></h2>



<p>For arrays/lists, this is an expression by which to order the elements before proceeding to marshal the object</p>



<h1 class="wp-block-heading has-medium-font-size"><strong>Unmarshalling</strong></h1>



<h2 class="wp-block-heading has-medium-font-size"><strong>Multi-Dimensional Arrays </strong></h2>



<p>You can also unmarshal multi-dimensional arrays. Multidimensional Arrays can be defined in simple words as array of arrays. For example if you received an XML payload with a multi-dimensional array like this:</p>



<p></p>



<p></p>



<pre class="wp-block-preformatted has-small-font-size"><em>&lt;soapenv:Body xmlns="http://schema.gluglobal.co.za/ssc/1.0/DeliveryTrip"&gt;
       &lt;route xmlns=""&gt;
           &lt;Zone&gt;CPT&lt;/Zone&gt;
           &lt;ZoneId&gt;910&lt;/ZoneId&gt;
           &lt;PlanReference&gt;0917360&lt;/PlanReference&gt;
           &lt;Personnel&gt;
               &lt;Driver&gt;
                   &lt;IdNumber&gt;0&lt;/IdNumber&gt;
                   &lt;Name&gt;CTH DUMMY DRIVER&lt;/Name&gt;
               &lt;/Driver&gt;
               &lt;CrewMembers&gt;
                   &lt;Crew&gt;
                       &lt;IdNumber&gt;0&lt;/IdNumber&gt;
                       &lt;Name&gt;CTH DUMMY CREW 1&lt;/Name&gt;
                   &lt;/Crew&gt;
                   &lt;Crew&gt;
                       &lt;IdNumber&gt;0&lt;/IdNumber&gt;
                       &lt;Name&gt;CTH DUMMY CREW 2&lt;/Name&gt;
                   &lt;/Crew&gt;
               &lt;/CrewMembers&gt;
           &lt;/Personnel&gt;
           &lt;RouteId&gt;2200268213&lt;/RouteId&gt;
           &lt;Consignments&gt;
               &lt;Consignment&gt;
                   &lt;ConsignmentId&gt;999&lt;/ConsignmentId&gt;
                   &lt;Dropoffs&gt;
                       &lt;Dropoff&gt;
                           &lt;Type&gt;Delivery&lt;/Type&gt;
                           &lt;DropoffId&gt;97625349782634&lt;/DropoffId&gt;
                           &lt;DueAt&gt;2019-12-04T09:00:00&lt;/DueAt&gt;
                           &lt;SpecialInstructions&gt;N/A&lt;/SpecialInstructions&gt;
                           &lt;Dimensions&gt;
                               &lt;Weight&gt;0&lt;/Weight&gt;
                               &lt;Pieces&gt;21&lt;/Pieces&gt;
                               &lt;Pallets&gt;0&lt;/Pallets&gt;
                               &lt;Volume&gt;
                                   &lt;Length&gt;0&lt;/Length&gt;
                                   &lt;Width&gt;0&lt;/Width&gt;
                                   &lt;Height&gt;0&lt;/Height&gt;
                                   &lt;Volume&gt;.633213465&lt;/Volume&gt;
                               &lt;/Volume&gt;
                           &lt;/Dimensions&gt;
                           ... etc.</em></pre>



<p>To unmarshall the Volume attribute, in the &#8216;Volume&#8217; Array, in your Object Collection Path you&#8217;d use the following:</p>



<p></p>



<figure class="wp-block-table"><table><tbody><tr><td><em>Envelope.Body.route.Consignments.Consignment[].Dropoffs.Dropoff.Dimensions.Volume</em></td></tr></tbody></table></figure>



<p></p>



<pre class="wp-block-preformatted"><br></pre>



<h2 class="wp-block-heading has-medium-font-size"><strong>Store As Object</strong></h2>



<p><strong>For this response</strong>:</p>



<p></p>



<figure class="wp-block-table"><table><tbody><tr><td><em>{ &#8220;result&#8221;: {&#8220;message&#8221;: {&#8220;prim_email_id&#8221;: [&#8220;20004: Duplicate email ID, Mobile Number exists&#8221;], &#8220;prim_id_no&#8221;: [&#8220;20006: Duplicate ID, ID Number exists.&#8221;], &#8220;prim_mob_no&#8221;: [&#8220;20002: Duplicate Mobile / Mobile Number exists&#8221;]}, &#8220;status&#8221;: &#8220;E&#8221;} }</em></td></tr></tbody></table></figure>



<p></p>



<p><br>Checking <strong>&#8216;Store As Object&#8217;</strong> allows for storing of the entire &#8220;message&#8221; as a single object.</p>



<p><br><br><strong>Note</strong>: Referencing this &#8220;message&#8221; requires the following format: [&#8216;message&#8217; without quotes]</p>



<p>{ &#8220;result&#8221;: { &#8220;message&#8221;:&nbsp;<strong>${message}</strong>, &#8220;status&#8221;: &#8220;${status}&#8221; } }</p>



<p></p>



<p></p>


<div class="wp-block-image">
<figure class="aligncenter size-full is-resized"><img loading="lazy" decoding="async" width="527" height="683" src="https://glu.global/wp-content/uploads/2023/01/image-117.png" alt="" class="wp-image-3778" style="width:440px" srcset="https://glu.global/wp-content/uploads/2023/01/image-117.png 527w, https://glu.global/wp-content/uploads/2023/01/image-117-231x300.png 231w, https://glu.global/wp-content/uploads/2023/01/image-117-39x50.png 39w" sizes="auto, (max-width: 527px) 100vw, 527px" /></figure></div>


<h1 class="wp-block-heading has-medium-font-size"><strong>FAQ&#8217;s</strong></h1>


<div class="hfaqwrapper" itemscope itemtype="https://schema.org/FAQPage" >
	<!-- no name title displayed -->
<ul id="hfaqgroup-0" class="hfaqlist" data-hfaq-style="style1" data-hfaq-type="accordion" data-hfaq-icon-pos="right" data-hfaq-icon="1" data-hfaq-behavior="none" >
											<li>		
					<div class="hfaq" data-hfaq-state="expanded" itemscope itemprop="mainEntity" itemtype="http://schema.org/Question">
						<div class="hfaq__question" id="marshalling-unmarshalling-what-is-marshalling-in-the-glu-engine">

							
							<div class="hfaq__icon" style="height: 20px; width: 20px;">

																	<svg class="hfaq__iconplus" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><g stroke-width="2" fill="none" stroke="#11a9d5" stroke-linecap="square" stroke-miterlimit="10"><path d="M12 7v10M17 12H7"/><circle cx="12" cy="12" r="11"/></g></svg>
								  <svg class="hfaq__iconminus" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" stroke-width="2"><g fill="none" stroke="#11a9d5" stroke-linecap="round" stroke-miterlimit="10" stroke-linejoin="round"><path d="M17 12H7"/><circle cx="12" cy="12" r="11"/></g></svg>
								
							</div>

							
							<span class="hfaq__text" itemprop="name">What is Marshalling in the GLU.Engine?</span>
						</div>
						<div class="hfaq__answer" itemscope itemprop="acceptedAnswer" itemtype="http://schema.org/Answer">
							<div class="hfaq__answercontent" itemprop="text"><p>Marshalling is the process of converting the GLU parameter into a format suitable for storage or transmission to a receiving system.</p></div>
						</div>
					</div>
				</li>
														<li>		
					<div class="hfaq" data-hfaq-state="closed" itemscope itemprop="mainEntity" itemtype="http://schema.org/Question">
						<div class="hfaq__question" id="marshalling-unmarshalling-what-is-unmarshalling-in-the-glu-engine">

							
							<div class="hfaq__icon" style="height: 20px; width: 20px;">

																	<svg class="hfaq__iconplus" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><g stroke-width="2" fill="none" stroke="#11a9d5" stroke-linecap="square" stroke-miterlimit="10"><path d="M12 7v10M17 12H7"/><circle cx="12" cy="12" r="11"/></g></svg>
								  <svg class="hfaq__iconminus" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" stroke-width="2"><g fill="none" stroke="#11a9d5" stroke-linecap="round" stroke-miterlimit="10" stroke-linejoin="round"><path d="M17 12H7"/><circle cx="12" cy="12" r="11"/></g></svg>
								
							</div>

							
							<span class="hfaq__text" itemprop="name">What is Unmarshalling in the GLU.Engine?</span>
						</div>
						<div class="hfaq__answer" itemscope itemprop="acceptedAnswer" itemtype="http://schema.org/Answer">
							<div class="hfaq__answercontent" itemprop="text"><p>Unmarshalling is the opposite of Marshalling, it&#8217;s the process of transforming the representation of an object into a format that the GLU.Engine can store and later use.</p><p> </p></div>
						</div>
					</div>
				</li>
														<li>		
					<div class="hfaq" data-hfaq-state="closed" itemscope itemprop="mainEntity" itemtype="http://schema.org/Question">
						<div class="hfaq__question" id="marshalling-unmarshalling-what-is-the-convention-for-referencing-variables-when-marshalling-in-the-glu-engine">

							
							<div class="hfaq__icon" style="height: 20px; width: 20px;">

																	<svg class="hfaq__iconplus" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><g stroke-width="2" fill="none" stroke="#11a9d5" stroke-linecap="square" stroke-miterlimit="10"><path d="M12 7v10M17 12H7"/><circle cx="12" cy="12" r="11"/></g></svg>
								  <svg class="hfaq__iconminus" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" stroke-width="2"><g fill="none" stroke="#11a9d5" stroke-linecap="round" stroke-miterlimit="10" stroke-linejoin="round"><path d="M17 12H7"/><circle cx="12" cy="12" r="11"/></g></svg>
								
							</div>

							
							<span class="hfaq__text" itemprop="name">What is the convention for referencing variables when Marshalling in the GLU.Engine?</span>
						</div>
						<div class="hfaq__answer" itemscope itemprop="acceptedAnswer" itemtype="http://schema.org/Answer">
							<div class="hfaq__answercontent" itemprop="text"><p>When Marshalling GLU parameters from within the GLU.Engine to be delivered to external systems, the convention is to reference the variables with the format ${variableName} or ${header.variableName} if passing the variable into the header (i.e. the Context Name/URL).</p></div>
						</div>
					</div>
				</li>
														<li>		
					<div class="hfaq" data-hfaq-state="closed" itemscope itemprop="mainEntity" itemtype="http://schema.org/Question">
						<div class="hfaq__question" id="marshalling-unmarshalling-what-is-the-format-for-incoming-variable-parameters-during-unmarshalling-in-the-glu-engine">

							
							<div class="hfaq__icon" style="height: 20px; width: 20px;">

																	<svg class="hfaq__iconplus" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><g stroke-width="2" fill="none" stroke="#11a9d5" stroke-linecap="square" stroke-miterlimit="10"><path d="M12 7v10M17 12H7"/><circle cx="12" cy="12" r="11"/></g></svg>
								  <svg class="hfaq__iconminus" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" stroke-width="2"><g fill="none" stroke="#11a9d5" stroke-linecap="round" stroke-miterlimit="10" stroke-linejoin="round"><path d="M17 12H7"/><circle cx="12" cy="12" r="11"/></g></svg>
								
							</div>

							
							<span class="hfaq__text" itemprop="name">What is the format for incoming variable parameters during Unmarshalling in the GLU.Engine?</span>
						</div>
						<div class="hfaq__answer" itemscope itemprop="acceptedAnswer" itemtype="http://schema.org/Answer">
							<div class="hfaq__answercontent" itemprop="text"><p>When receiving an incoming variable parameter during Unmarshalling in the GLU.Engine, the variable format is simply {} without the $ sign.</p></div>
						</div>
					</div>
				</li>
				</ul>
</div>
<style>
	#hfaqgroup-0 .hfaq[data-hfaq-state="expanded"] .hfaq__text {
		color: #11a9d5;
	}
</style>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
