This document covers the following topics:
This scenario uses the tools IDL Extractor for COBOL and Integration Server Wrapper of the Designer.
Under z/VSE batch, a COBOL server with a standard call interface can be called.
Extract the interface of the COBOL server program. See Using the IDL Extractor for COBOL - Overview. | |
Generate REST resources, connection and adapter services in Integration Server. | |
Execute the call from the REST client to the COBOL server program. |
This scenario makes the following important assumptions:
You have a working COBOL batch server. For illustration and examples on such a server, see Batch with Standard Linkage Calling Convention.
You have access to the related COBOL sources and copybooks as files on your local machine. The minimum requirement is the
DATA DIVISION
of the interface. More info
You have an Integration Server with EntireX Adapter installed.
You have a REST client.
You can call the COBOL server program at runtime using different methods:
For the EntireX RPC connection method you need
For the EntireX Direct RPC connection method you need:
See also Direct RPC in the EntireX Adapter documentation.
Follow the instructions for extracting COBOL, see Using the IDL Extractor for COBOL - Overview and choose Scenario I: Create New IDL and Server Mapping Files if this is your first extraction. Learn how to invoke the IDL Extractor for COBOL, create a COBOL Extractor Environment and about the possibilities to select the COBOL source.
The extraction process creates the following EntireX metafiles:
IDL file. A Software AG IDL file contains definitions of the interface between client and server. See Software AG IDL File in the IDL Editor documentation.
Server mapping file (optional). The mapping file is a Designer file with extension .cvm that contains COBOL-specific mapping information. See Server Mapping Files for COBOL in the Designer documentation.
Note:
Before you start your first extraction, in the Preferences page Software AG > EntireX > COBOL, set the Type of COBOL mapping to Server-side Mapping (instead of the default Client-side Mapping).
This means you will generate server mapping files with extension .svm (rather than the default .cvm) when generating COBOL
mapping files in the Designer.
See How to Set the Type of Server Mapping Files.
The following COBOL server is used to illustrate the features of the IDL Extractor for COBOL. Imagine an existing COBOL server
called EMPLOYEE
.
It implements the access logic for a LIST
and DETAILS
function to a database view EMPLOYEE
:
Two approaches for extracting the COBOL server are described below:
Fast-track
Learn how EntireX helps you to connect the COBOL Server with quick results.
User-defined Mapping
The following features are among those available with a user-defined mapping:
Shape the interface to your COBOL server
You can minimize the interface by suppressing COBOL server fields or by providing constant values.
Renaming interfaces allows you to specify a readable long name.
These two features together - constants and renaming of interfaces - are most powerful when multiple interfaces are implemented
in a single COBOL server.
Each function of the COBOL server triggered by an operation code or function code can be modelled as a separate REST resource
method/operation.
Select alternative mappings
You can select alternative mappings for COBOL data items (REDEFINE
s, tables etc.) to enable scenarios with COBOL servers where data exchange is not fully described by the LINKAGE SECTION
COBOL data items.
These approaches are described under Fast-track Method and Modern Method below.
To extract the COBOL Server
Swich to the EntireX perspective.
Call the IDL Extractor for COBOL.
Set the correct interface type as described under Step 4: Define the Extraction Settings and Start Extraction under Scenario I: Create New IDL and Server Mapping Files in the IDL Extractor for COBOL documentation.
Press
to enter the COBOL Mapping Editor.The purpose of the COBOL Mapping Editor is to map COBOL data items to IDL (Interface Definition Language) parameters. It consists of three main areas:
The upper window pane is the COBOL program source.
The window pane on the left-hand side is the COBOL interface, consisting of COBOL data items representing the parameters in your COBOL server program.
The window pane on the right-hand side is the IDL interface consisting of IDL parameters.
For more information see Mapping Editor User Interface in the IDL Extractor for COBOL documentation.
COBOL extraction is a two-step process:
First, select the COBOL parameters using the
and from the context menu on the COBOL data items in the upper window pane (COBOL source); in many situations the COBOL interface is detected by the Mapping Editor directly and you can omit this step.Then map the COBOL parameters to IDL directions using the
buttons. COBOL parameters do not have directions, they are always INOUT. This step can be left out for a quick test in non-production scenarios; for real production it is recommended to set IDL directions to reduce data transfer. You also have the option to assign a meaningful name to an IDL parameter if the original COBOL data item is not self-explanatory.For our example:
Set EMPLOYEE-ID
as IDL direction (see screenshot in previous step).
For EMPLOYEES-DETAILS
and EMPLOYEES
perform the similar .
Use the function IDL Interface pane
to rename COBOL parameter EMPLOYEES-ID
to IDL parameter ID
. Do the same for EMPLOYEE-DETAILS
: Rename to EMPLOYEE
.
Press
. The default extraction settings ensure you get useful results. The outcome is a Software AG IDL file (interface definition language), a Designer file with extension .idl:If required, a server mapping file with the same name as the IDL file but the extension .cvm or .svm may be generated too,
for technical reasons.
This file must always be stored together with the concomitant IDL file. For more information, see Server Mapping Files for COBOL in the Designer documentation.
By default, the interface name EMPLOYEE
is taken from the COBOL server program name.
EntireX allows you to extract all implemented interfaces of the COBOL server separately.
Instead of a large EMPLOYEE
interface, separate interfaces getListOfEmployees
and getDetailsOfEmployee
are extracted.
Each interface contains required parameters; obsolete parameters for an interface are suppressed, improving its usability.
To extract a COBOL server with a user-defined mapping
Shape EMPLOYEE
to getDetailsOfEmployee
:
Mark the OPERATION
field in the COBOL Interface pane and press the button.
In the pop-up window, select OPERATION-DETAILS
(red markers). The OPERATION-DETAILS
value originates from COBOL level-88 data item (blue markers).
If there is no COBOL level-88 enumeration type in the COBOL program defined, you can enter the function code manually
in the pop-up window.
By default the IDL interface gets the same name as your COBOL server: EMPLOYEE
.
Use the button from the toolbar of the COBOL Mapping Editor and change the IDL interface name to getDetailsOfEmployee
(blue markers).
This name is used as the IS service name later.
Continue shaping, making getDetailsOfEmployee
easier to use:
Use the context menu of the redefinition of the DETAIL
field in the COBOL Interface pane, FILLER REDEFINES DETAIL
and choose (blue markers). A redefinition is a secondary layout (field types) of the same memory area.
The redefinition contains more specific information (ANNUAL-SALARY
, VACATION
, etc.) than character buffer DETAIL
.
This is the reason why it is more useful in your interface.
Use the context menu of FILLER_1
in the IDL interface pane and rename FILLER_1
to DETAILS
(green markers) for a readable IS service field name later.
The DETAILS
function in the COBOL server does not make use of the EMPLOYEES
field.
Therefore you can leave it out of the interface: use the context menu of the EMPLOYEES
field in the COBOL Interface pane and choose (red markers).
Shape EMPLOYEE
to getListOfEmployees
Function:
The COBOL Mapping Editor allows you to define multiple IDL interfaces to the same COBOL server:
You create the additional IDL interface using the toolbar button getDetailsOfEmployee1
is created. The previously extracted getDetailsOfEmployee
interface still exists in the first tab.
Once you reactivate the first tab, you will see the interface of getDetailsOfEmployee
again.
Use the
button from the toolbar of the COBOL Mapping Editor and change the IDL interface name to (blue markers). This name is used as the IS service name later.For the LIST
function you need the OPERATION-LIST
value in the OPERATION
field: Mark the OPERATION
field in the COBOL Interface pane and press the button.
In the pop-up window, select OPERATION-LIST
(similar to Step 1. above Shape EMPLOYEE
to getDetailsOfEmployee
; red markers).
Use the context menu of the EMPLOYEES
field in the COBOL Interface pane, EMPLOYEES OCCURS 1 TO 99
and choose (Similar to Step 2. above Continue shaping, making getDetailsOfEmployee
easier to use; blue markers).
Because the EMPLOYEE
and EMPLOYEE-DETAIL
fields are not used in the COBOL server LIST
function, you leave them out in the IDL interface: use the context menu of EMPLOYEE-DETAIL
field in the COBOL Interface pane and choose (similar to Step 2. above Continue shaping, making getDetailsOfEmployee
easier to use; red markers). Do the same for the EMPLOYEE-ID
field.
Press Server Mapping Files for COBOL. The Software AG IDL File describes the interfaces from the client point of view, while the server mapping file contains the mapping to the real COBOL server. Both of these files must be kept together and in sync, otherwise a call to the COBOL server may fail.
to retrieve the extraction result in the form of a Software AG IDL file. At the same time, a server mapping file for COBOL (Designer file with extension .cvm) is created. SeeTo summarize: We created two IDL interfaces.
In the IDL file, these resulted in two IDL programs: getListOfEmployees
and getDetailsOfEmployee
.
Both IDL programs were given readable names (Steps 1 and 3). Meaningful fields were kept, while superfluous fields were
suppressed (Steps 1 and 3).
The program getDetailsOfEmployee
contains the redefined fields of parameter DETAILS
(see below) mapped during extraction (Step 1).
Note:
During runtime, the RPC client generated with the extracted interface will send data for the redesigned interfaces, while
your COBOL server still expects EMPLOYEE
data.
The EntireX runtime transforms the incoming data stream from the RPC client, using the server mapping file.
The following table highlights the differences when shaping an interface with a user-defined mapping compared with a fast-path extraction.
Interface Shaping with User-defined Mapping | Fast-path Extraction | |
---|---|---|
General | User-defined interface with dedicated mapping. For our example, the interfaces are small and tidy and more self-explanatory
with long, readable interface names. They are easier to use with the hidden OPERATION field and the suppressed COBOL fields, which are not needed.
|
Automatic, quick result extraction with COBOL-like interfaces on IS. For our example, the IS interface EMPLOYEE matches exactly 1:1, field by field.
|
IS service(s) | Multiple small and handy IS services; each OPERATION code is mapped to a separate IS service.
|
One big IS service. |
IS service name | Readable long name. | Short Subprogram name; up to 8 characters. |
IS fields | Usage of | and reduces the message length. This keeps focus on relevant data items and keeps the client's interface clean. It may also improve performance.The IS fields and COBOL server parameters match 1:1. As COBOL layout descriptions are sometimes used for many different purposes, irrelevant data items appear and clutter up the IS interface. |
OPERATION parameter
|
Suppressed: the OPERATION parameter does not exist in the IS service as an IS field.
|
The OPERATION parameter exists in the IS service as an IS field and needs to be filled-in by the client endpoint.
|
OPERATION code
|
The OPERATION code is provided internally by EntireX runtime in the OPERATION field.
|
The OPERATION code needs to be specified in the IS service in the OPERATION field by the client endpoint.
|
REDEFINE parameters
|
Either the parameter that is redefined or one of its redefinitions is available as an IS field. | Only the parameter that is redefined is available as an IS field. Redefinitions of the parameter are not available as IS fields. |
A user-defined mapping enables you also to define alternative mappings for COBOL data items (REDEFINE
s, tables etc.).
These enable scenarios with COBOL servers where data exchange is not fully described by the LINKAGE SECTION
COBOL data items.
For more information refer to the IDL Extractor for COBOL documentation:
The following pictures use the extraction results described under Extracting a COBOL Server - Modern Method with User-defined Mapping.
To test the extraction results (optional)
You can test the results of the extraction operation and the REST server back end, using the EntireX IDL Tester. From the context menu of the IDL file in the Designer, choose
.Select getDetailsOfEmployee.
Note that the broker and server parameters contain the explicit route to call the server program, and you can optionally ping the connection from this client. With the
> dialog, you can set:User and Password for broker authentication
RPC User ID and RPC Password for server authentication
See EntireX IDL Tester in the Designer documentation.
Check the Integration Server log, the EntireX Adapter log or the RPC logs. Applies to all connection methods.
This section describes your first steps to create a new Integration Server connection. This is described in more detail under Using the Integration Server Wrapper, for example working with existing Integration Server connections. This section covers the following topics:
To start the Integration Server Wrapper wizard
In the context menu of a Software AG IDL file, choose
.This starts the wizard with a list of existing Integration Server Wrapper connections.
Note:
If the selected IDL file is not valid because of a syntax error,
an error dialog comes up and the wizard does not start.
Continue with Step 2: Create a New Integration Server Connection.
To create a new Integration Server connection
Define the new Integration Server connection on the wizard page.
Notes:
Choose
and continue with Step 3: Select the Connection Type.To create a new connection
Select a connection type from the drop down list. Connection types are described under EntireX Adapter Connections in the EntireX Adapter documentation and Introduction to the Integration Server Wrapper.
Note:
The list of connection types is filtered: connection types that require a license are only shown if a corresponding license
file is available.
Reliable RPC connections are only shown if all IDL programs contain only IN parameters.
Also, if a server mapping file is available, only those connection types that support the interface type specified in the
server mapping file are shown.
Click
and continue with Step 4: Define Adapter Services for an RPC Connection.To create a connection and related adapter services
Select a package for the created objects.
Define a folder name. If the folder does not exist, it will be created.
Define a connection name.
Define the parameters of the connection type. For details, see the EntireX and your webMethods Integration Server Applications.
As a result, the folder will contain the connection and the adapter services (one for each IDL program). The name of a service is the same as the respective IDL program.
The default settings for the adapter services are:
the Default package; if not available, the first package
the IDL library name for the Folder Name
the IDL library name with the suffix "Connection" for the Connection Name
Note:
When creating a connection, a package dependency is added such
that the selected package depends on webMethods EntireX
(the package WmEntireX
) with the version currently used.
To create or update a REST resource
Make sure checkbox Create or Update REST resource is checked.
Select a package.
Define a folder name. If the folder does not exist, it will be created.
Define the REST Resource name.
Check Update existing Resource if you want to add additional services to an existing resource.
To edit the REST resource
Switch to the Service Development perspective of Software AG Designer.
Refresh the package where you generated the REST Resource in the previous step.
Open the REST Resource.
Edit the REST URLs and HTTP Methods to match the functionality of your application.
For more information see:
REST Developer's Guide in the webMethods Integration Server documentation for information on using the generated REST resources
Configuring a REST Resource Using the URL Template-Based Approach in the online help provided under Software AG Designer Guides > webMethods Service Development Help > Working with REST
Use an appropriate REST client, specify URL, Method and Headers and invoke your REST resource: