The Progress OpenEdge Data Object Handler (DOH) is a built-in Web Handler that enables you to design your own ABL service interface and expose ABL data objects as RESTful resources in a configurable way. It is available via the WEB transport in Progress Application Server for OpenEdge (PAS for OpenEdge).
If you have developed Progress ABL Data Object Services, you have already used the DOH under the hood.
How the DOH works
The DOH class implements the Progress.Web.IWebHandler interface, and is a more dynamic and business-ready form of the OpenEdge.Web.WebHandler class. With the DOH, you create an ABL service, set it to use the DataObjectHandler class, and then map custom service endpoints with ABL classes and procedures in a JSON mapping file.
At runtime, when a service endpoint is called, the DOH transforms the HTTP request into an ABL object and invokes the associated ABL class or procedure. It also transforms the output from the ABL class or procedure into an HTTP response.
Overview of steps to use the DOH
1. Create an ABL service — You begin by creating an ABL service that uses the DOH class.
2. Create a mapping file — You then create a mapping file with the same name as the ABL service.
3. Define custom service endpoints — You start describing the service interface in the mapping file by defining your custom endpoints.
4. Associate HTTP verbs with operation handlers — For each service endpoint, you associate an HTTP verb (GET, PUT, POST, etc) with one of the following operation handlers:
void, that returns only a status code
file, that returns the contents of a file
entity, that invokes an ABL class or procedure
Should I use DOH or write my own Web Handler?
For an ABL developer, the Data Object Handler relieves the burden of transforming HTTP requests and responses into ABL objects. It does so in a standard way. However, if you have very specific needs, writing your own Web Handler may be the right solution.
Should I use the DOH or a mapped REST service?
Although you can also define a custom service interface using a mapped REST service (that uses the PAS for OpenEdge REST transport), a DOH-based ABL service offers the following advantages over the mapped REST service:
It supports more content types.
It is easier to debug, since the DOH is an ABL class. You can also readily inspect and modify its JSON mapping file.
It is more customizable; you can extend its functionality by accessing its class events. To learn more about these class events, see the white paper on using the Data Object Handler.
It uses the WEB transport, which is the recommended way to expose your ABL applications as RESTful services. This is because the WEB transport uses the ABL WebHandler class and thus provides better insight and control over your ABL service.