Using a simple indexed file, create a web service that implements CRUD

One popular organizing design pattern is the Create, Read, Add, Delete (CRUD) function group for persistent storage in an application. The acronym CRUD is often used to describe this function group. By adding the capability to browse on one or more fields (as provided by tutorial1), and by a careful renaming of the functions, we can create a design pattern known as BREAD (Browse, Read, Edit, Add, Delete).

The BREAD design pattern applied to an indexed file, or a multiple related indexed files, is useful in exposing data in an existing application. tutorial2 provides an example of a web service implementing the BREAD function set on a single indexed file.

tutorial2 illustrates a few more naming conventions that are useful in communicating information between the COBOL service program and the XSLT style sheet. First, if you wish to control the case of the characters that spell a method name, you may override the default behavior of folding the method name to lower case. This is shown on each of the methods. In particular, you place a method--METHOD-NAME data item at the same level as the method--METHOD-PARAMETERS group item. The desired spelling (differing in case only) is entered as the value of the method--METHOD-NAME data item. Note that the values in the method--METHOD-NAME items must be maintained for both WSDL and response export.

In a similar manner, one can control the externally visible naming of parameters. This is illustrated in the Browse method output‑parameter definition, where the data item found‑item‑‑name is used to rename the very COBOL‑like name found‑record to FoundRecord. Note that, unlike method names, the desired spelling can be different for data item names that are output parameters; however, spellings for input parameters may differ only in case.

Finally, also in the Browse method output‑parameters, the specially named data item found‑record‑‑count is used to communicate the number of occurrences that should be exported. A ‑‑count data item may also be used on an imported data item array so that the actual number of array items imported may be known.