In your docker build try this sequence:

USER root
RUN apt-get clean -yq && apt-get update -yq && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends openjdk-11-jdk
USER ${ISC_PACKAGE_MGRUSER}


Or install sudo (very bad practice in containers):

USER root
RUN apt-get clean -yq && apt-get update -yq && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends tzdata curl gnupg ca-certificates sudo
RUN /bin/echo -e ${ISC_PACKAGE_MGRUSER}\\tALL=\(ALL\)\\tNOPASSWD: ALL >> /etc/sudoers
RUN sudo -u ${ISC_PACKAGE_MGRUSER} sudo echo enabled passwordless sudo-ing for ${ISC_PACKAGE_MGRUSER}
USER ${ISC_PACKAGE_MGRUSER}

Have you tried wrapping your message call (Ens.Director and OnProcessInput) in a class on the target machine.

/// -------- This is on the source machine
/// Source (LIS) Method
ClassMethod ConnectAndCall(host, port, namespace, user, pwd) As %Status
{
    // Our object is defined somewhere
    #dim TRAN As %RegisteredObject = $$$NULLOREF
    Set sc = $$$OK
    // Connect to our HC machine
    set connection = ##class(%Net.DB.DataSource).CreateConnection(host, port, namespace, user, pwd)
    if 'connection.IsConnected set ERRTXT="NotConnected" quit $$$Error($$$GeneralError, "Couldn't connect")
    set irisC=connection.CreateIris()
 
    // Instead of multiple calling with response objects wrap everything on the client
    set response = irisC.ClassMethodValue("Helpers.Ens", "SendMessage", "ServiceName", TRAN)
    do connection.Disconnect()
 
    Return sc
}
 
/// ---------- This is on the target machine
/// healthconnect method (target machine)
/// Classname: "Helpers.Ens.SendMessage()"
ClassMethod SendMessage(servicename, message) As %RegisteredObject
{
    // Find running job of servicename
    Set sc = ##class(Ens.Director).CreateBusinessService(servicename, .serviceHandle)
    // Call that service
    Set sc = serviceHandle.OnProcessInput(message, .response)
    return response
}

The method you want to change the language (locale or NLS) is Config.NLS.Locales -- Install()

You can see the available locales at this portal page: [System Administration] > [Configuration] > [National Language Settings] > Locale Definitions

So to put that into a manifest:

    <Namespace Name="%SYS" Create="no">
        <Log Text="Changing the Locale" Level="0"/>
        <Invoke Class="Config.NLS.Locales" Method = "Install" CheckStatus="true">
            <Arg Value="danw"/> 
            <!-- danw is the Danish Locale, Replace with Desired  -->
        </Invoke>
    </Namespace>

Hi Craig,

ImportFromString returns an HL7 Message, it does not populate an existing instance of EnsLib.HL7.Message.

Moreover, make sure that you are reading the entire message with %request.Content.Read, you'll probably want to wrap that in a loop.

Here is the code I get to work on my instance (2017.1)
 

SET tContent = %request.Content.Read()
WHILE '%request.Content.AtEnd {
SET tContent = tContent + %request.Content.Read()
}
SET tReq = {}.%FromJSON(tContent)
SET tInput = tReq.Message
// Remove your %New() statement and set tMsg like this
SET tMsg = ##class(EnsLib.HL7.Message).ImportFromString(tInput)
// Then you can either set the doctype manually or use PokeDocType()
// ...

You can change the header keys of a %Net.HttpRequest

// Make Request
  SET tHttpRequest=##class(%Net.HttpRequest).%New()

  // Set header
  SET tSC = tHttpRequest.SetHeader("Content-Type", "text/plain")

  // Check for Errors
  THROW:$$$ISERR(tSC) ##class(%Exception.StatusException).CreateFromStatus(tSC)

Thus, to put this all together;

  1. Extend the EnsLib.HL7.Operation.HTTPOperation
  2. Copy the SendMessage method from the super EnsLib.HL7.HTTPOperation
  3. Make a small change to set the header after the first line.
// Sample Code, Not Complete
Class Niko.EnsLib.HL7.Operation.HTTPOperation Extends EnsLib.HL7.Operation.HTTPOperation
{

Method SendMessage(pMsgOut As EnsLib.HL7.Message, Output pMsgIn As EnsLib.HL7.Message, pExpectedSequenceNumber As %String) As %Status
{
    Set pMsgIn=$$$NULLOREF, tHttpRequest=##class(%Net.HttpRequest).%New(), tHttpRequest.WriteRawMode=1
    // Add these two lines after the firt in SendMessage. Change the content type to your desired header.
    SET tSC = tHttpRequest.SetHeader("Content-Type", "text/plain")
    THROW:$$$ISERR(tSC) ##class(%Exception.StatusException).CreateFromStatus(tSC)

    // Copy the rest of the SendMessage Method from the standard EnsLib.HL7.Operation.HTTPOperation
}
}