Creating REST Services in Caché
DocServer Sample

The Samples namespace contains the DocServer REST sample, which returns information about the documentation for Caché classes. You can view the REST.DocServer source in Studio. The comments at the beginning of the sample describe the URLs that you use to invoke the REST services. You can invoke the sample REST services that use an HTTP GET operation using a web browser. For example, if you enter the following:

The sample returns the namespaces defined in Caché. But, to invoke REST services that use other HTTP operations, such as POST, you need to use an HTTP utility, such as cURL.
The docserver sample is a simple example without any security. By default, its web application is disabled to prevent unauthorized users from accessing namespace data. Consequently, before running the sample, you must enable its web application. To do this:
  1. On the Web Applications page ([System Administration] > [Security] > [Applications] > [Web Applications]), select the /csp/samples/docserver application.
  2. On the General tab, enable the web application by selecting the Enabled Application check box.
  3. Select Save.