RESTful services


Business Entities of the SmartComponent Library can be exposed as RESTful services. RESTful services provide an alternative HTTP and JSON based interface which is very common for providing interfaces to 3rd party applications or mobile applications (the JSDO generic service is specialized to be used by JSDO based clients).

A few useful articles on the subject:

We support exposing Business Entities to provide resource collections and individual resources through simple HTTP URI's. We support GET (read), POST (create), PUT (update), DELETE and PATCH (partial update) methods. 

Setting up the PASOE environment

We support exposing Business Entities as RESTful services through a PASOE Web Handler. 

Registering the Web Handler

The Web Handler must be registered in the file:

Note, that OpenEdge does not seem to support gaps in the numbering of Web Handlers. The handler28= ... is only supposed to serve as an example.

The entry registers the RestEntitiesWebHandler for the /web/Entities URI. From OpenEdge 11.7 on, we support using any other URI prefix instead of /Entities. OpenEdge 11.6 does only support the /Entities URI prefix.

Initializing the REST Address Service

While starting the PASOE ABL sessions, we need to initialize the RestResourceService (as an Service Instance of the IRestResourceService). This service is responsible to map the request URI to a specific Business Entities and provides the configuration to build a FetchDataRequest. The Service can be loaded through the provided services.xml file:


The contents of the services.xml file can also be merged with any other services.xml file if preferred. The Service follows the CCS IService Interface and requires the initialize() method to be executed when launched (the Consultingwerk.Framework.ServiceLoader will call the initialize() method). During the start, the RestAddressService will provide logging output like this. 

The logging output requires the RestResource custom log entry type to be active.

Configuring Business Entities as RESTful resources

There are two requirements for Business Entities as RESTful resources:

ISupportsRestAddress Interface

Business Entities exposed as RESTful resources must implement the Consultingwerk.OERA.RestResource.ISupportsRestAddress interface. The interface requires the GetRestAddress() method. This method is already implemented by the Consultingwerk.OERA.BusinessEntity base class - so that basically the ISupportsRestAddress is a marker interface.

The GetRestAddress() method is used at runtime to register URI's of RESTful resources with Business Entities. The Business Entity returns the RESTful URI's it supports along with the meta data defining the details of the associated requests.

@RestAddress annotations

Business Entities define the details of the RESTful access through annotations (see The Annotation based Type Descriptor).

Overview of Annotation Parameters

Parameter NameDescription
typeThe type of the request, either "resource" for a single record, or "collection" for list of records

The URI template. "/Customers/{CustNum}" means that the resources can be accessed using the resulting URI like http://localhost:8820/web/Entities/Customers/1 - The {CustNum} placeholder represents a field used in the resulting QueryString (FOR EACH eCustomer WHERE eCustomer.CustNum = 1). There can be multiple placeholders in a single URI template (e.g. /Customers/{CustNum}/Orders/{OrderNum}/OrderLines/{OrderLine}

Collection or singleton (a single record resource that does not require any further selection criteria) may not require any value placeholder at all.

tablesThe comma delimited list of tabels requested from the Business Entity (FetchDataRequest:Tables property) to serve the request
idThe comma delimited list of fields used to return the ID of a resource
fieldsThe comma delimited list of fields returned to the caller (by default), possible values may be field names, tablename.fieldname's or tablename.*
canReadtrue/false, logical value determing of the URI supports read requests
canUpdatetrue/false, logical value determing of the URI supports update requests (PUT and PATCH) - supported for individual records only
canCreatetrue/false, logical value determing of the URI supports create requests (POST) - supported for collections only
canDeletetrue/false, logical value determing of the URI supports delete requests - supported for collections and individual records

links to resource URI's for the child records returned by the request, comma delimited list, entries are in the form of {tablename}:{uri pattern}, e.g.

linksHATEOAS style links (to other business entities) in the form of {rel}:{uri pattern}, e.g.

Query String Parameters

RESTful requests for collections can be filtered using query stirng parameters.

Parameter NameDescription
fieldscomma delimited list of field names to be returned
sortThe sort criteria as a comma delimited list in the form of +fieldname or -fieldname, e.g. sort=+country,-city
limitThe maximum number of records returned from a collection
offsetThe first record to be returned, allows paging in combination with the limit parameter, e.g. limit=20&offset=20
{fieldname}filter criteria, e.g. salesrep=BBB&creditlimit>=10000 - supported operators are =, >=, <=, >, <>, <

Supported Operators

The following query operators are supported by the RESTful interface:

  • =, [=], [EQ]
  • <>, [<>], [NE]
  • >, [>], [GT]
  • <, [<], [LT]
  • >=, [>=], [GE]
  • <=, [<=], [LE]
  • [BEGINS]

Invoking Business Entity and Business Tasks Methods through the RESTful interface

See Support for RESTful invocation of Business Task and Business Entity Methods.



Returns the first three customers by CreditLimit descending. Returns also links to orders of that customer and the salesrep.





Returns the customer with the CustNum of 3. Returns links to orders and salesrep (links property) as well as a preview of the eSalesrep record returned by the Business Entity (childAddresses property)





Returns the "Partially Shipped" Orders of Customer number 3. The request is served by the Orders Business Entity, the Customer Business Entity is not involved in the request.