Unmarshalling & Marshalling Concepts

Marshalling 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’s representation. 

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.

Unmarshalling and Marshalling can be used to change the names or formats of parameters between systems and restructure them into or out of Arrays. 

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


This is when a GLU.Engine converts a GLU parameter object into Receiving System object.

In the example below, a Parameter named ‘routeDescription’ is being marshalled to the body of the outgoing request. The template for this request (as defined in the parent Request Manager) is:


{ “routeDescription” : “${routeDescriptionNewName}” }

Therefore, ‘routeDescription’ is being marshalled into ‘routeDescriptionNewName’, to be available in the request body.

Note: The addition of the ‘NewName’ 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 Header or the Query.

The Header refers to the ‘Context Name’ of the Request Manager. For example, to route to a variable after the /, you would need to use the .header syntax as follows:


… and you would Marshal the ‘headerStub’ attribute to the Header as follows:


The Query refers to the section following the ‘Context Name’ in the Request Manager. For example, to route to a variable after /stub/echo?appId=test , you would need to marshal it to the Query as below.

Exception: 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 ?key in the URL, for example:


Example: Keep The Value Null

When the GE receives a parameter with a null value, e.g. { “nullParam1”: null } in the payload

The GLU.Engine will pass it as an EMPTY parameter because null is a GLU reserved word (Reserved Words). Therefore the option “Keep the value null” is to pass it as null i.e. the text ‘null’ remains as it is.

e.g. response : “nullParam1”: null

Example: Do not pass empty or null values

On receiving a null value, this parameter is ignored and not marshalled.

Definition: ’empty’ – is when the parameter exists but there is no value e.g. “value1” : “”

Definition: ‘null’ – is when the parameter does not exist e.g. if expecting to see “value2” in a Response body but “value2” does not exist.

Order By

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


Multi-Dimensional Arrays

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:

<soapenv:Body xmlns="http://schema.gluglobal.co.za/ssc/1.0/DeliveryTrip">
       <route xmlns="">
                   <Name>CTH DUMMY DRIVER</Name>
                       <Name>CTH DUMMY CREW 1</Name>
                       <Name>CTH DUMMY CREW 2</Name>
                           ... etc.

To unmarshall the Volume attribute, in the ‘Volume’ Array, in your Object Collection Path you’d use the following:


Store As Object

For this response:

{ “result”: {“message”: {“prim_email_id”: [“20004: Duplicate email ID, Mobile Number exists”], “prim_id_no”: [“20006: Duplicate ID, ID Number exists.”], “prim_mob_no”: [“20002: Duplicate Mobile / Mobile Number exists”]}, “status”: “E”} }

Checking ‘Store As Object’ allows for storing of the entire “message” as a single object.

Note: Referencing this “message” requires the following format: [‘message’ without quotes]

{ “result”: { “message”: ${message}, “status”: “${status}” } }


  • What is Marshalling in the GLU.Engine?

    Marshalling is the process of converting the GLU parameter into a format suitable for storage or transmission to a receiving system.

  • What is Unmarshalling in the GLU.Engine?

    Unmarshalling is the opposite of Marshalling, it’s the process of transforming the representation of an object into a format that the GLU.Engine can store and later use.


  • What is the convention for referencing variables when Marshalling in the GLU.Engine?

    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).

  • What is the format for incoming variable parameters during Unmarshalling in the GLU.Engine?

    When receiving an incoming variable parameter during Unmarshalling in the GLU.Engine, the variable format is simply {} without the $ sign.

Was this article helpful?

Related Articles

Fill the form and we’ll contact you shortly

    I agree with

    We uses cookies to make your experience on this website better. Learn more
    Accept cookies