Question
· Dec 12, 2017

ERROR #5003: Not implemented

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
}
}
Discussion (3)1
Log in or sign up to continue

You have compilation error(s). That's why one or more methods are not generated, so instead methods in Ens.BusinessOperation gets called. These methods are returning not implemented error.

To start with 

 Extends (Ens.BusinessOperation, )

should be:

 Extends Ens.BusinessOperation

You can check which exact method has not been generated in Ensemble Event Log.

UPD. [@Rajiv Bhatia] solution is correct, my bad. Should have read your code.