Skip to content

The Input String Generator

The COBOL-IT Bridge Program is designed to receive URL-encoded XML. The Input Generator produces a message, which, when sent to the Bridge Program, will be decoded, and the appropriate Entry point will be CALL’ed. That is, if the Input is being generated for a POST function, the message will be decoded and the Entry point associated with the POST function will be CALL’ed. There, the POST operation will take place, and the results will be returned to the Bridge Program, which will return them back to the Client.

Saving Input Strings in text files in your project

Before generating the Input Strings for our Web Services, we will create empty text files as place holders to save the generated strings. We will create an untitled text file called poststring and save it in the Strings Folder.

Text Files

Generating input data

In this example, we will generate input data for a POST function. You will note that in the Entry Mapping interface, the postholiday entry point, which is associated with the POST function is selected. The message that is generated is structured such that the postholiday entrypoint will be CALL’ed, and pass data through the linkage section.

For the separate cases, where you wished to GET, or PUT, or DELETE this record, you would require separate generations of input data, in which the getholiday, putholiday, or deleteholiday entry point, with their associated function, was selected.

Click on the Show Structure I-O messages icon to generate a structured I-O message. In the message, you will see the castings that have been made. You can, for the purposes of testing, or for generating input data for use, overwrite a casting message with a data value.

In our example, for our holidays application, we have entered a holiday name of Christmas, along with the subsequent date information of Wednesday, December 25, 2019. The hol-id of 0 will be replaced with a 1 when the record is posted. When the record is posted, we will also see a current date-time stamp, and a message will be generated reporting on the success or failure of the operation.

Generate Input Data

Click on the Copy Input message button to copy the INPUT STRING to the clipboard. Click OK.

Save the INPUT STRINGs in your project

Paste the INPUT STRING into the empty text file you have created, and save the file.

The INPUT STRING includes the program name that will be CALL’ed by the Bridge Program, the ENTRY point name, in this case postholiday, that will be called in the program, and descriptions of the USING data elements being passed in through the linkage section. When first generated, the INPUT STRING is not URL-encoded.

poststring

poststring

getstring

The INPUT STRING for getholiday only requires the entry of the primary key, in this case, the holiday-name, or hol-name as it is called in the Linkage Section.

The INPUT STRING includes the ENTRY point name, in this case getholiday, that will be called in the program, and descriptions of the USING data elements being passed in through the linkage section.

getstring

putstring

The INPUT STRING for putholiday only requires the entry of the primary key, in this case, the holiday-name, or hol-name as it is called in the Linkage Section.

putstring

The INPUT STRING includes the ENTRY point name, in this case putholiday, that will be called in the program, and descriptions of the USING data elements being passed in through the linkage section.

deletestring

The INPUT STRING for deleteholiday only requires the entry of the primary key, in this case, the holiday-name, or hol-name as it is called in the Linkage Section.

The INPUT STRING includes the ENTRY point name, in this case deleteholiday, that will be called in the program, and descriptions of the USING data elements being passed in through the linkage section.

deletestring

Summary

The COBOL-IT Web Services provides an interface which allows the user to parse a COBOL program with one or more entry points containing a USING clause that references a linkage section, and creates the artifacts required to generate INPUT STRINGs for each of the Entry points in the program with USING clauses.

The INPUT STRINGs are in XML format. In the natural course of electing a POST, GET, PUT, or DELETE function, this INPUT STRING will be URL-encoded. The BRIDGE PROGRAM is designed to decode the URL-encoded XML, populate the linkage items for a given entry point, and call the selected ENTRY point in the host program.

We have seen how to use the COBOL-IT Web Services Interface to produce the intermediate artifacts, the XSD and WSV file, and the final artifacts, the INPUT STRINGs and the BRIDGE PROGRAM. Next, we will use test cases to take a more detailed look at the Environment Setup, Entry Mapping and different solution scenarios.

Back to top