Create a REST service
The content is under construction. We are sorry for the inconvenience.
Before creating a REST service, it is recommended be familiarized with naming conventions and recommended structures for building REST services, more information can be found in REST service guidelines.
Define a REST service
Create a new REST service
In Genus Studio, navigate to the REST Services in Services and click New. Specify Name and Path Segment for the service.
HTTP headers for request and response can defined here if applicable for all resources in the rest service, headers that only apply to specific resources or methods for resource can be specifed at the applicable level.
The Description and Support fields are specifed to provide Metadata information for the service.
Add a Resource
Right click on the REST service (top) node in the tree view, and select Add Resource. Specify Path Segments for the resource, at least one is required to identify the resource. There are several types of path segments that can be specified. These can be divided into two main parts, descriptive (Literal) and parameters (String, Integer, LargeInteger, Real, CalendarTime, Guid). Descriptive path segments are used to specify resource types and operations. And parameter path segments are used to identify resources and can be mapped to fields in a Data Source when defining a Method for the resource.
Query parameters can be specified to receive additional parameters for request processing.
HTTP headers can be specified on the resource level if applicable for all methods on the resource.
The Description fields are specifed to provide Metadata information for the service.
Add a Method
Right click on the Resource node in the tree view, and select Add GET, Add PUT, Add DELETE or Add POST. Only instance for each method can be specified for a resource.
HTTP headers can be specified on the method level. All inherited HTTP headers are also available for mapping to Data Sources for processing.
The Summary and Description fields are specifed to provide Metadata information for the service.
Mapping parameters to a Data Source
Values of parameters in path segments, query parameters and HTTP headers can be mapped to a Data Source in Method. The mapping is completed automatically when specifiying a Data Source in the Save to: or Read from: dropdowns in the API tab on the method level. The Data Source must be added to the method in the Data Sources tab, and in many instances a Local object is the preferred Data Source. The mapping is performed based on the provider name of the properties on the Data Source.
Security
Security is specified on the REST service level. Right click on the REST Service in main window, select Properties and click on the Security tab. Add the Security Groups which should have access to consuming the REST service. To consume a REST service the users must have the Privilege Consume a Web Service.
Auditing
Auditing is specified on the Method level on the REST Service. Right click on the method and select Properties, click on the History tab. If Save detailed exectuion trace in history is specified, the HTTP body, headers and parameters are logged for both request and response. To view the the History on the method, click on the Events... button in the History tab.