Skip to main content

This is documentation for Caché & Ensemble.

For information on converting to InterSystems IRISOpens in a new window, see the InterSystems IRIS Migration Guide and Migrating to InterSystems IRIS, both available on the WRC Distributions pageOpens in a new window (login required).

Developing a REST Service

This section describes how to provide a REST service from an Ensemble Business Service and to pass the request to a Business Process or Business Operation. It lists the best practice for different requirements.

If you want to:

  • Parse and process the request in the production—use a subclass of %CSP.RESTOpens in a new window and call the Ens.Director.CreateBusinessService() method to instantiate the class as a business service. This service uses Ensemble’s CSP port.

  • Pass through a REST URL to an external server with minimal changes—use the pass-through REST service, EnsLib.REST.GenericServiceOpens in a new window.

For details on implementing a subclass of %CSP.RESTOpens in a new window, see Creating REST Services in Caché.

For an example of using the Ens.Director.CreateBusinessService() method, use Studio to examine the class Demo.ZenService.Zen.WeatherReportForm.cls. Although this is a Zen service rather than a REST service, you would use the Ens.Director.CreateBusinessService() method in the same way.

For details on using the pass-through REST service, see the sections on pass-through business services in “Configuring ESB Services and Operations” and “Pass-through Service and Operation Walkthrough” in Using Ensemble as an ESB.

Note:

Although Ensemble defines a class EnsLib.REST.ServiceOpens in a new window, that is a subclass of %CSP.RESTOpens in a new window, we recommend that you not use this class because it provides an incomplete implementation of %CSP.RESTOpens in a new window. The only feature that EnsLib.REST.ServiceOpens in a new window provides that is not available from %CSP.RESTOpens in a new window is the ability to use a special port, but we recommend against using a special port because it does not provide the robustness and security you get by using a commercial web server and the CSP port.

FeedbackOpens in a new window