This tutorial walks through the process of deploying an existing COBOL application as a Web service within the JBoss Application
Server. To achieve this, the COBOL application is deployed as Java byte code so that it is easily accessible by a Java class
that provides the Web service interface.
The web service interface is designed by reviewing the interface to the COBOL program. From this the Web service operations
and parameters are created using a visual editor. Once the Web service is designed, a Java class can be automatically generated
that represents the implementation of the Web service.
The overall Web service application comprises:
- A project that contains an unmodified legacy COBOL program.
- A small wrapper COBOL program that makes the file status more helpful to a caller. This wrapper program uses smart linkage,
which makes it possible to call a procedural COBOL program from Java by exposing the linkage parameters as native Java types.
- A project that contains the definition of the Web service to the outside world.
- A Web project that contains the Java server code which interfaces with the outside world and a Java class to bridge the gap
between the service code and the COBOL application.
- The client, an automatically generated test harness.
About the Book application
This tutorial uses the
BookLegacy.cbl application to demonstrate several modernization options available with Visual COBOL.
BookLegacy.cbl is a simple stock control system for a library or bookstore and provides standard operations to create, read, update and
delete entries which are stored using an indexed file. The interface to this application has several parameters:
procedure division using by value lnk-function
by reference lnk-b-details
by reference lnk-file-status.
- Input parameters
- lnk-function 01 pic x.
- Corresponds to either:
- 1
- read-record
- 2
- add-record
- 3
- delete-record
- 4
- next-record
- Input/output parameter
- lnk-b-details 01 group.
- Contains the author, title, and related information.
- Output parameter
- lnk-file-status 01 pic xx.
- The Micro Focus file status code.
Four operations are represented by this interface: add book, next book, read book and delete book. These operations are exposed
as part of the Web service. The part of the design process that represents this COBOL interface in a manner more suitable
for a Web service is called a WSDL.