vRO: Missing Line Breaks in SOAP Request

While working in vRealize Orchestrator with an external SOAP based system I was having issues with line breaks being removed from text sent across as part of a reasonably large SOAP request containing multiple items.

Say we have the following text strings and want to pass them into the SOAP request with line breaks in-between each one:

[code language=“javascript”]

text1 = ‘This is text1’; text2 = ‘This is text2’; text3 = ‘This is text3’;

textToSend = ‘\n’ + text1 + ‘\n’ + text2 + ‘\n’ + text3;

[/code]

Place that code into a scriptable task in a workflow, output textToSend to the vRO SystemLog and you will observe the text with line breaks in them, placing each one onto its own line:

However, when textToSend is sent through to the SOAP request, the line breaks have been removed and the text appears in the interface all on one line, displaying it like so:

Turns out in this instance the SOAP request would support HTML tags for the text, so using ‘’ instead of ‘\n’ would give the line break.

[code language=“javascript”]

text1 = ‘This is text1’; text2 = ‘This is text2’; text3 = ‘This is text3’;

textToSend = ‘’ + text1 + ‘’ + text2 + ‘’ + text3;

[/code]

The SystemLog now looks like this:

However, we don’t really care what it looks like in there, the important thing is how it translates through in the SOAP request. It is now displayed as desired:

This also means that any HTML formatting tag could potentially be used if say the text needed to be made Bold or a different size.