Cache Ensemble
Hello,
Working on to learn very basic CUSTOM Business Service which sends to a
But operation is not writing to File and erroring out (No Stream contained in StreamContainer Request")'.
How do convert the object to STREAM and wrap in the StreamContainer so the operation does not error and write to a file.
Thanks.
Persistent Class
{
Property PatientId As %Stream.FileCharacter;
Property PatientName As %Stream.FileCharacter;
..
Custom Service reads from a file
{
set tSC = $$$OK
set pInput.LineTerminator=$c(10)
try
{
while 'pInput.AtEnd {
set tMsg = ##class(Hospital.PatientApptRequest).%New()
set tLine = pInput.ReadLine()
set tMsg.PatientId = tLine
set tLine = pInput.ReadLine()
set tMsg.PatientName = tLine
do pInput.ReadLine()
set tRequest1=##class(Ens.StreamContainer).%New(tMsg)
set tSC = ..SendRequestAsync(..TargetConfigNames,tRequest1)
} }
catch ex
{
set tSC = ex.AsStatus()
}
quit tSC
}
Sample File contents
1
ABC
2
DEF
Thanks,
Jimmy Christian.