Question
· May 8, 2022

Handling %GlobalCharacterStream in a Production Service

Hi Guys,

I've a Production Service that receives a CharacterStream and save it in a Global, then a second classmethod that pick up that CharacterStream from the global and process it, but for some reason it fails when i comes  Set HTTPURL = $ZCVT($G(pInput.Attributes("URL")),"U") which error saying "INVALID OREF", as I checked it seems that pInput is has a CharacterStream but not sure why is says invalid Object ref (see attached)?

 

Method OnProcessInput(pInput As %CharacterStream, Output pOutput As %CharacterStream) As %Status
{
   Set pOutput=##class(%GlobalCharacterStream).%New()
   cnt=$O(^NQLIn(""),-1)
    ^NQLIn(cnt+1)=pInput
     res= ##Class(MSDS.Common.Task.NQLINPostProcess).ProcessInput(cnt)
     Do pOutput.WriteLine("202")
     Do pOutput.Flush()
    Quit $$$OK
}

ClassMethod ProcessInput(Count As %String) As %String
{
set status=$$$OK
set HTTPURL = "unknown"
set start = $ZDATETIME($h,-2)
try{
Set pInput=##class(%GlobalCharacterStream).%New()
pInput=^NQLIn(Count)
     Set HTTPURL = $ZCVT($G(pInput.Attributes("URL")),"U")
    
 

 

Thanks

Product version: Ensemble 2014.1
Discussion (2)1
Log in or sign up to continue