Salesforce

How to turn off the Callstack (_stack) value in PASOE Data Object Service json response?

« Go Back

Information

 
TitleHow to turn off the Callstack (_stack) value in PASOE Data Object Service json response?
URL NameHow-to-turn-off-the-Callstack-stack-value-in-PASOE-Data-Object-Service-json-response
Article Number000130905
EnvironmentProduct: OpenEdge
Version: 11.7.4
OS: All supported platforms
Question/Problem Description
How to turn off the Callstack (_stack) value in PASOE Data Object Service json response?

When using the PASOE Web Transport and returning an error from the Data Object Service, the Callstack stack trace ( _stack) of the error is displayed in the JSON response:

// 20190530104655
// http://localhost:8840/myWebDataObjSrvcProj2/web/pdo/myUnitsWebDataObjSrvc/beUnits

{
  "_retVal": "An Error has occurred",
  "_errors": [
    
  ],
  "_stack": [
    "ReadbeUnits beUnits at line 85  (D:\\Work\\117\\PASOE-Work\\oepas4\\openedge\\beUnits.r)",
    "Execute OpenEdge.Web.DataObject.ClassOperationHandler at line 26305  (OpenEdge/Web/DataObject/ClassOperationHandler.r)",
    "PerformOperation OpenEdge.Web.DataObject.DataObjectHandler at line 618  (OpenEdge/Web/DataObject/DataObjectHandler.r)",
    "HandleRequest OpenEdge.Web.DataObject.DataObjectHandler at line 451  (OpenEdge/Web/DataObject/DataObjectHandler.r)",
    "HandleRequest OpenEdge.Web.DataObject.DataObjectHandler at line 354  (OpenEdge/Web/DataObject/DataObjectHandler.r)",
    "HandleRequest OpenEdge.Web.InternalWebRouter at line 113  (OpenEdge/Web/InternalWebRouter.r)"
  ]
}
 

This is a potential security risk when accessing the Business Entity.  How can this feature be turned off?
Steps to Reproduce
Clarifying Information
Error Message
Defect NumberOCTA-14071
Enhancement Number
Cause
The problem is caused by the ERROR-STACK-TRACE attribute.   The SESSION:ERROR-STACK-TRACE attribute defaults to FALSE, but it is being switched to TRUE internally by the Log Manager.    A defect has been logged to prevent this from happening.  
Resolution
Fixed version(s): 11.7.5.0, 12.1.0.0
Workaround
In the Data Object service code, set the SESSION:ERROR-STACK-TRACE = FALSE, for example:
 
@openapi.openedge.export(type="REST", useReturnValue="false", writeDataSetBeforeImage="false").
@progress.service.resourceMapping(type="REST", operation="read", URI="?filter=~{filter~}", alias="", mediaType="application/json"). 
METHOD PUBLIC VOID ReadbeUnits(
    INPUT filter AS CHARACTER, 
    OUTPUT DATASET dsUnit):

    SESSION:ERROR-STACK-TRACE = FALSE.
    RETURN ERROR "An Error has occurred".       
END METHOD.    

 
Notes
In OpenEdge 11.7.5 and OpenEdge 12.1 the JSON stack (_stack) will be controlled by both SESSION:ERROR-STACK-TRACE and the SESSION:DEBUG-ALERT flag.
oth of these will need to be enabled in order to see the '_stack' in ERROR objects.
Keyword Phrase
Last Modified Date11/29/2023 6:40 PM

Powered by