Discussion (6)0
Log in or sign up to continue

Hi

 

This is what my business operation looks like method looks like.


Method GetResultspRequest As GOSHPackage.Messages.PPID.Request.MyRequest, Output pResponse As GOSHPackage.Messages.PPID.Response.MyResponse) As %Status
{
Set tSC = $$$OK
Set pResponse = ##class(GOSHPackage.Messages.PPID.Response.MyResponse).%New()

Try
{
Set tSC = ..Adapter.Connect()
Throw:($$$ISERR(tSC))
Set tSC = ..Adapter.SetAutoCommit(1)
Throw:($$$ISERR(tSC))
$$$LOGINFO("2")

Set tQuery = "SELECT top 3 surname, forename FROM [dbo].[tblTest]"

//set tQuery =..Adapter.Query
$$$LOGINFO("3")
Set tSC = ..Adapter.ExecuteQuery(.tResults,tQuery,)


Throw:($$$ISERR(tSC))

set snap=##class(EnsLib.SQL.Snapshot).%New()
set tSC = tResults.GetSnapshot(.snap)
set pResponse.TestRS =snap
Throw:($$$ISERR(tSC))
$$$LOGINFO("5")
}
Catch tException
{
Set tSC = ##class(%SYSTEM.Status).Error(tException.AsStatus,tException.Name_" Threw an Error "_tException.DisplayString)
}                                                                          
Quit tSC
}

This populates the snapshot however when I am trying to get the response back in to the BPL I get the following error

 

ERROR <Ens>ErrBPTerminated: Terminating BP PPID Shadow Processor # due to error: ERROR <Ens>ErrException: <INVALID OREF>zOnResponse1+2^GOSHPackage.Process.PPID.PPIDShadowProcess.Context.1 -- logged as '-' number - @' Set status=1,context.TestRS=callresponse.TestRS' > ERROR <Ens>ErrException: <INVALID OREF>zOnResponse1+2^GOSHPackage.Process.PPID.PPIDShadowProcess.Context.1 -- logged as '-' number - @' Set status=1,context.TestRS=callresponse.TestRS'

 

I am unsure whether this is the right approach, any help would be appreciated.

 

Thank you.

 

Salma