Provides important specifications for creating JSON (RESTful) service interface operations.
When defining a JSON (RESTful) service interface, you have the option to create a set of operations based on the group structures
in the selected COBOL entry point. You are presented with a set of options via the
API Resources wizard. The options that appear on this wizard are derived from the COBOL entry point specified for the service interface.
Tip: We recommend that you work through
Tutorial: JSON RESTful Web Service using API Resources to become familiar with this feature.
The
API Resources wizard presents one resource entry for each COBOL group item in the chosen entry point. In general, the default methods selected
for each resource are a GET operation for retrieving the group item, and a PUT operation for updating the item. However, for
each COBOL group item defined with a nonzero OCCURS clause (i.e., an array), two separate resource entries are presented as
follows:
- The first entry is for accessing the collection defined by the array resource as a whole. By default, this resource selection
has a GET method selected for retrieving the entire collection, and a POST method for adding a singleton resource (single
element) to the collection.
- The second entry is for accessing a singleton resource within the collection. By default, this resource selection has a GET
method selected for retrieving an item in the collection, a PUT method for updating an item, and a DELETE method for removing
an item from the collection.
The default relative path provided for each COBOL resource listed on the
API Resources wizard is derived from the field groupings defined in the resource, and represents the relative path portion of the request
URI. See
HTTP Method/Path for details.
Important: Before you click
OK to create the operations, you may select any or all resources listed on the
API Resources wizard, and also modify the default path and method settings for any selected resource. See
To generate new API resource operations for details.
Enterprise Developer creates a new and separate operation for each selected method of each selected resource. For example, if you select both
a GET and PUT method for a single selected resource,
Enterprise Developer creates two operations - one for the GET method and one for the PUT method.
The resulting operations are defined as follows:
- A GET operation has an interface field group mapped to, and with the same Occurs value as, the COBOL group.
- A POST operation has an interface field group mapped to the COBOL group, but with an Occurs value of 1.
- PUT and DELETE operations each have an interface field group mapped to the COBOL group, with an Occurs value of 1. In addition,
each has a path-type interface field that corresponds to a parameter in the relative URI path that identifies the operation.
This path-type field is meant to be used as an index for identifying which item in the collection is to be accessed.
Note: For more information about relative URI paths, see
HTTP Method/Path. For more information about path-type fields, see
Body, Path, and Query fields.
The following topics provide important details about JSON (RESTful) service interface concepts: