I have a business operation which I want to run an d I keep getting the above error have tried trace and logging every stage but can not figure out why the error comes from I am expecting this service to run everytime it is called hence the implementation so could anyone help out please
Operation
Class XmlToJsonOperation Extends (Ens.BusinessOperation, )
{
Parameter ADAPTER = "EnsLib.File.OutboundAdapter";
Property Adapter As EnsLib.File.OutboundAdapter;
Parameter INVOCATION = "Queue";
Property CompiledStyleSheet As %XML.XSLT.CompiledStyleSheet;
/// Style sheet to convert Message to Json
Property XLTStyleSheet As %String(MAXLEN = "");
Parameter SETTINGS = "XLTStyleSheet:Basic";
Method XmlToJson(pRequest As EnsLib.EDI.XML.Document, Output pResponse As Ens.Response) As %Status
{
set tSC=$$$OK
set oInStream = ##class(%Library.GlobalCharacterStream).%New()
set outputiing =##class(%Stream.FileCharacter).%New()
set tSC = pRequest.OutputToLibraryStream(oInStream)
if ($$$ISOK(tSC))
{
$$$TRACE("we in the if")
$$$LOGINFO("we in the if")
do ..OnInit()
$$$LOGINFO("we in OnIT")
set outputiing= ..getJSON(oInStream)
$$$LOGINFO("On The Stream")
set fileName="json.txt"
set tSC=..Adapter.PutStream(fileName,outputiing)
}
Quit $$$ERROR($$$NotImplemented)
}
XData MessageMap
{
<MapItems>
<MapItem MessageType="EnsLib.EDI.XML.Document">
<Method>XmlToJson</Method>
</MapItem>
</MapItems>
}
/// This user callback method is called via initConfig() from %OnNew() or in the case of SOAP Services from OnPreSOAP()
Method OnInit() As %Status
{
set tXSL=..XLTStyleSheet ;; file path from parameter
Set tSC=##class(%XML.XSLT.CompiledStyleSheet).CreateFromFile(tXSL,.tCompiledStyleSheet)
set ..CompiledStyleSheet=tCompiledStyleSheet
$$$TRACE("compliled sheet name"_..CompiledStyleSheet)
$$$LOGINFO("gone pass the trace compile")
Quit $$$OK
}
Method getJSON(inStream As %Stream)
{
set tSC=$$$OK
set tSC=..CompiledStyleSheet
if ($$$ISERR(tSC))
{
$$$LOGINFO("Error on the Complied sheet")
$$$LOGINFO(tSC)
}
set tSC=inStream
if ($$$ISERR(tSC))
{
$$$LOGINFO("Error on the instream")
$$$LOGINFO(tSC)
}
Set tSC=##class(%XML.XSLT.Transformer).TransformStreamWithCompiledXSL(inStream,..CompiledStyleSheet,.tOutput)
If ($$$ISERR(tSC))
{
$$$LOGINFO("Error on the getJson")
$$$LOGINFO(tSC)
}
quit tOutput
}
}

