The AppServerStatus section helps you identify the status of the AppServer associated with the REST services in your REST Web application.
The following is a sample JSON output of the AppServerStatus section.
{
"AppServerStatus":{
"PingStatus":"true",
"ABLReturnVal":""
"Error": {
_errorMsg:"[Error message (if any) while running the
ABL code]"
_errorNum:"[Error number associated with the error
message]"
}
},
"RESTServices":[...]
}
The JSON output consists of the following nodes:
PingStatus — If the value of the PingStatus node is true, it implies that the REST Adapter can ping, or connect with, the AppServer associated with the REST services. If the value is false, it implies that there is a problem in connecting with the AppServer, and the Error node displays an error message.
You can disable the REST Adapter from performing the ping by setting the value of the appServerPing context parameter to 0 in the web.xml file of the REST Web application.
<!-- Enable or disable the AppServer ping (0 = Disable; 1 = Enable) -->
<context-param>
<param-name>appServerPing</param-name>
<param-value>0</param-value>
</context-param>
ABLReturnVal — The ABLReturnVal node consists of a status message that is returned by an ABL method. This method is configured in the web.xml file of the REST Web application. By default, an empty string is returned with the ServerStatus() method of the OpenEdge.Rest.Admin.AppServerStatus class. If the REST Adapter is unable to connect with the AppServer, the Error node displays an error message.
You can customize the status message that is returned in the ABLReturnVal node.
To create a customized status message:
1. Create an ABL class and define the serverStatus() method to return the desired message. You must save the file in $WRKDIR.
The following is a sample ABL class, MyPing, with the serverStatus() method defined to return a character output:
USING Progress.Lang.*.
BLOCK-LEVEL ON ERROR UNDO, THROW.
CLASS MyPing:
method public char serverStatus( ):
return "A developer can customize this".
end.
END CLASS.
2. Set the value of the ABLMethod context parameter in the web.xml file.