I did a search for STRINGSTACK. Then I was able to solve this issue by changing Write param.%ToJSON() to Do param.%ToJSON()

This is in Docs for %ToJSON():

method %ToJSON(outstrm As %Stream.Object) as %String

Convert a %DynamicAbstractObject into a JSON string.

outstrm is optional. There are a number of possibilities:
(1) Parameter outstrm is not defined and the method is called via 'DO'. In this case the JSON string is written to the current output device.
(2) Parameter outstrm is not defined and the method is called as an expression. In this case the JSON string becomes the value of the expression.
(3) Parameter outstrm is defined. If it is %Stream object then the JSON string will be written to the stream. If outstrm is present but not an object then it is presumed to be a fully qualified file specification. In that case, a %Stream.FileCharacter stream is created, linked to that file and the JSON string is written to that stream. On completion, this stream is saved. The full path to the file must be defined. If outstrm is an object but is not an instance of %Stream.Object then an exception will be thrown.

The error from Prepare will write to messages.log with this change:

Class otw.dynq

{

ClassMethod prepareQ() As %Status

{

    Set result=##class(%ResultSet).%New("%DynamicQuery:SQL")

    Set sc=result.Prepare("SELECT %ID, Name, Salary FROM Sample.Employee WHERE Salary > ?")

    If $$$ISERR(sc) {

        // here I want to capture the error details in trace , log , that I can see in production web page

        Try {

            Set x = $System.Status.GetOneStatusText(sc)

            Do ##class(%SYS.System).WriteToConsoleLog("otw.dynq prepareQ: "_x)

        } Catch exception {

            Do BACK^%ETN // Log error in error log

        }

    }

    Quit sc

}

}

I created a class for dynamic query:

Class otw.dynq

{

ClassMethod prepareQ() As %Status

{

    Set result=##class(%ResultSet).%New("%DynamicQuery:SQL")

    Set sc=result.Prepare("SELECT %ID, Name, Salary FROM Sample.Employee WHERE Salary > ?")

    If $$$ISERR(sc) {

        // here I want to capture the error details in trace , log , that I can see in production web page

        Try {

            Do ##class(%SYS.System).WriteToConsoleLog("%ZSTART Routine: "_"Import Users",0,0)

        } Catch exception {

            Do BACK^%ETN // Log error in error log

        }

    }

    Quit sc

}

}

I call the Dynamic Query Prepare from BPL and Trace the Status Text from the Prepare:

///

Class otw.bplJSON2HL7 Extends Ens.BusinessProcessBPL

{

/// BPL Definition

XData BPL [ XMLNamespace = "http://www.intersystems.com/bpl" ]

{

<process language='objectscript' request='Ens.Request' response='Ens.Response' height='2000' width='2000' >

<context>

<property name='dynPrepareStatus' type='%Library.Status' instantiate='0' />

</context>

<sequence xend='200' yend='750' >

<trace name='request.Stream.Read()' value='request.Stream.Read()' xpos='200' ypos='250' />

<assign name="dynPrepareStatus" property="context.dynPrepareStatus" value="##class(otw.dynq).prepareQ()" action="set" xpos='200' ypos='350' />

<trace name='dynPrepareStatus' value='$System.Status.GetOneStatusText(context.dynPrepareStatus)' xpos='200' ypos='450' />

<transform name='otw.dtlJSON2HL7' class='otw.dtlJSON2HL7' source='request' target='response' xpos='200' ypos='550' />

<call name='HL7FileOperation' target='HL7FileOperation' async='1' xpos='200' ypos='650' >

<request type='Ens.Request' >

<assign property="callrequest" value="response" action="set" />

</request>

<response type='Ens.Response' />

</call>

</sequence>

</process>

}

Storage Default

{

<Type>%Storage.Persistent</Type>

}

}

The code is in this GitHub repo:

https://github.com/oliverwilms/HL7

Class HS.Local.Example.ProcessBPL Extends Ens.BusinessProcessBPL
{ Storage Default
{
<Type>%Storage.Persistent</Type>
} /// BPL Definition
XData BPL [ XMLNamespace = "http://www.intersystems.com/bpl]
{
<process language='objectscript' request='EnsLib.HTTP.GenericMessage' response='EnsLib.HTTP.GenericMessage' height='2000' width='2000' >
<context>
<property name='SuccessResponse' type='%String' instantiate='0' >
<parameters>
<parameter name='MAXLEN'  value='50' />
</parameters>
</property>
<property name='ConvertedStream' type='Ens.StreamContainer' instantiate='0' />
</context>
<sequence xend='200' yend='1000' >
<code name='ConvertedStream' xpos='200' ypos='250' >
<![CDATA[ If 1=request.%IsA("Ens.StreamContainer") {
   Set context.ConvertedStream = request
 }
 If 1=request.%IsA("EnsLib.HTTP.GenericMessage") {
   Set context.ConvertedStream = ##class(Ens.StreamContainer).%New()
   Set context.ConvertedStream.Stream = ##class(%GlobalCharacterStream).%New()
   Set tSC = context.ConvertedStream.Stream.CopyFrom(request.Stream)
   Set context.ConvertedStream.OriginalFilename = $Piece(request.HTTPHeaders.GetAt("RawParams"),"=",2)
 }
 If 1=request.%IsA("EnsLib.Kafka.Message") {
   Set context.ConvertedStream = ##class(Ens.StreamContainer).%New()
   Set context.ConvertedStream.Stream = ##class(%GlobalCharacterStream).%New()
   Set tSC = context.ConvertedStream.Stream.Write(request.value)
   Set context.ConvertedStream.OriginalFilename = request.key
   Set tSC = context.ConvertedStream.%Save()
 }]]>
</code>
<if name='Check Test Transaction' condition='context.ConvertedStream.OriginalFilename="TEST.txt"' xpos='200' ypos='350' xend='200' yend='700' >
<false>
<code name='Store Document' xpos='335' ypos='500' disabled="false">
<![CDATA[ Set tSC = ##class(HS.Local.VA.eSCM.FMS.Util).StoreStream(context.ConvertedStream,context.ConvertedStream)]]>
</code>
<call name='Call ToIrisMail Operation' target='ToIrisMail' async='0' xpos='335' ypos='600' >
<request type='Ens.StreamContainer>
<assign property="callrequestvalue="context.ConvertedStreamaction="set" />
</request>
<response type='EnsLib.HTTP.GenericMessage/>
</call>
</false>
</if>
<code name='setting of success response' xpos='200' ypos='800' >
<![CDATA[ Set context.SuccessResponse = ""
 If 1=request.%IsA("EnsLib.HTTP.GenericMessage") {
   Set tmp = ##class(%Library.GlobalBinaryStream).%New()
   Set tSC = tmp.Write("File received successfully")
   Set tSC = tmp.%Save()
   Set context.SuccessResponse=##class(EnsLib.HTTP.GenericMessage).%New(tmp,,request.HTTPHeaders)
   Do context.SuccessResponse.HTTPHeaders.SetAt("HTTP/1.1 200 OK","StatusLine")
   Set tSC = context.SuccessResponse.%Save()
 }]]>
</code>
<assign name="send response back" property="responsevalue="context.SuccessResponseaction="set" xpos='200' ypos='900' />
</sequence>
</process>
} }
 

I just searched history and found these commands somebody else had used. Maybe some could help you:

sudo podman login containers.intersystems.com

sudo podman search containers.intersystems.com/intersystems/irishealth

sudo podman image list  containers.intersystems.com/intersystems/irishealth

sudo podman pull containers.intersystems.com/intersystems/webgateway-arm64:2022.2.0.372.0

sudo podman search --list-tags containers.intersystems.com/intersystems/arbiter-arm64

Hello, Thembelani,

I have implemented a similar case in this app:

https://github.com/oliverwilms/irisrest/blob/master/src/App/REST.cls#:~:...

Important helper method is this:

/// Helper method
ClassMethod GetJSONFromRequest(Output obj As %DynamicObject) As %Boolean
{
    Set ok = 1
    Try {
        Set obj = ##class(%DynamicObject).%FromJSON(%request.Content)
    } Catch ex {
        Set ok = 0
    }
    Quit ok
}

Best regards,

Oliver