my full support to 3 !!!!   and to 5, 2, 4 in this priority.

The difference between   ANSWER and COMMENT  causes  more confusion than being helpful.
Especially in the actual sequence.
Comment to Answers eventually may make sense. 
More than once I found myself in a Comment where it should have been an Answer.  

My suggestion:

 -handle all editing just in a modal pop-up .
- allow deleting (or hiding) your entry if you don't feel it appropriate anymore.

For the cube you have servermgr.exe where you define the ports you want to use 
docs: http://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=...

 

In CSP gateway (from Mgmt Portal) you have Configuration -> Deault Parameters ->Instance Host Name: to set server + port

docs: http://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=...

if you disable authentication  for  Username / PW you always come in as "UnknownUser"

in Mgmt Portal go to  System > Security Management > Users > Edit User for "UnknownUser"

and set Startup Tag^Routine:  ^%zmyLOGIN
and then do your own authetication.

if you intend to go to Prorammer Mode you just have to call "do ^%PMODE" at the end.
otherwise the terminal closes.

Conversion of XML to objects is a standard function in Caché.
start with http://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=...

and continue http://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=...

the principle steps

  • generate a package o classes from XML Schema
  • import your XML File to this package
  • - - -  change whatever you want to change
  • use %XML.Writer  to generate a new export file.

a different approach could be to use XSLT to transform your XML file
http://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=...

Whatever better fits to reach your goal.

Take the example from %Net.SMTP to SAMPLE or USER independent of any ENS*

http://docs.intersystems.com/latest/csp/documatic/%25CSP.Documatic.cls?P...

and see if it runs on all 3 instances to verify SMTP access.

If it fails you may take a closer look to your firewalls  outgoing  and on SMTP server incoming.

If this works on all 3 instances than your config in ENSEMBLE is somehow different .

OR

in SAMPLES use Class Cinema.Utils. SendEmail(...) and adjust is to your needs

~~~

I'm not sure this really your problem. It could be. 

The first TEST should be your Mgmt Portal.

Language definitions are predefined and loaded at installation time.
to change it later from Mgmt Portal: 
System > Configuration > Locale Definitions 

If you run on UNICODE it should be enough to change it to PTBW - Portuguese, Brasil, Unicode (comboBox)

ending 8 = 8 bit encoded
ensing W = WIDE = Unicode

If your system is any 8bit installation. Someone else may have an answer. It may cause some troubles on a running installation. I never touched this.