Generating artifacts for an API requester from the command line
Enter the zconbt command on the command line to generate the artifacts to call an API from your z/OS® application.
Before you begin
- Ensure that the IBM® z/OS Connect build toolkit is installed. For more information, see Installing the IBM z/OS Connect build toolkit.
- Prepare the Swagger file of the API that your z/OS application wants to call. The IBM z/OS Connect build toolkit uses the Swagger file as an input to generate artifacts to call the API. For more information about the Swagger file and the generated artifacts, see Using the build toolkit to generate artifacts for an API requester.
About this task
Follow these steps to use the IBM z/OS Connect build toolkit to generate the API information file, data structures, and API requester archive for a z/OS application to call a RESTful API. The following steps use an example of calling the Watson™ translator API from a COBOL application.
To learn more about the build toolkit, see The IBM z/OS Connect build toolkit.
For best results, generate the data structures on the z/OS platform directly. If you want to run the build toolkit on a non-z/OS platform, set a non-z/OS code page, such as UTF-8, by specifying the generatedCodePage property in the build toolkit properties file and upload the generated data structures to the z/OS data set in ASCII mode via FTP.
If you use EDCDIC when generating data structures on a non-z/OS platform and upload the data structures to a z/OS data set in Binary mode via FTP, the data structures might be corrupted because of the different newline characters in different platforms.
For more information about the generatedCodePage property, see The build toolkit properties file.
Procedure
Results
Several artifacts for the API requester are created in the directories you have created. For each API, an API requester archive (.ara) file and a summary report are generated. For each API operation, an API information file, request data structures and response data structures are generated. The names of the generated request and response data structures and API information file are based on the requesterPrefix value that is specified in the properties file. For more information about the names of the generated artifacts, see Naming conventions for the API requester artifacts.
The following screen capture shows the expected API requester artifacts.
