Configure and test your connection to IMS. The procedure is
described in the scenario Create a server and connect to IMS and installs relevant
artifacts by using the supplied configuration template sampleImsPhonebook,
including the phonebook service.
Use the z/OS Connect API
toolkit to
Stop the phonebook service, and then Remove the
phonebook service.
About this task
In this scenario, the API toolkit, running on a Windows
workstation is used to re-create the IMS
phonebook service. The service archive file uses an existing IMS COBOL copybook from the IMS phone book
application.
This scenario uses the following values:
IMS region = IMS1
IMS program = PROG1
IMS transaction code = IVTNO
Procedure
Copy the IMS phone book COBOL copybook structure to a
folder on your workstation, for example, C:/COPYBOOKS/IMSPHBK.cpy, making sure that the asterisks
are in column 7.
From the main menu, select Window > Open Perspective > Other
The Select Perspective wizard opens.
Click z/OS Connect.
Click OK.
The z/OS Connect perspective opens.
Select File > New > Project.
The New Project wizard opens.
Select z/OS Connect > z/OS Connect Service Project, and click Next.
Specify a project name, select the project type, and optionally provide a description.
Specify the project name, phonebook.
For project type, select IMS Service.
Click Finish to create the project.
Figure 1. The New project wizard
The service project is created in the Project Explorer view. The service
definition opens in the service project editor, where you can configure the service and define the
service interface. The IBMz/OS Connect service project editor opens, with some errors initially that indicate some
required information is still missing. Figure 2. The definition page in the service project editor
For the transaction code to invoke, specify IVTNO.
In the following steps, you create the service interface for the request and response
message. In this step, you import the COBOL data structure into this project and specify which
fields are to be exposed for input and output messages.
In the Define Request and Response Service Interfaces section, click
Create Service Interface.
In the following steps, you create a service interface for the request
messages.
Specify a name such as phonebookRequest for the service interface. This
service interface can later be identified as the request service interface for this service project.
It can also be reused by other service projects.
Click the button to import the phone book copybook.
In the Import wizard, import the input and output message data
structures.
From the Import from: list, select Local file
system.
For the Source folder: field, select the folder where you copied the
phonebook copybook to, for example, C:/COPYBOOKS
From the File type: list, select COBOL data structures
only.
On the Data structure file: field, click Browse.
In the Select File dialog, navigate to the phone book copybook file
IMSPHBK.cpy on your workstation. For example, C:/COPYBOOKS and click
Open.
Specify the data structure for the input messages:
In the Data structure name list, select
IVTNO_INPUT_MSG.
For the Message name list,
<service_interface_name> is automatically
selected.
For the Segment name list, ensure that Segment 1
is selected.
Click Add to Import List to add this message data structure to the
Import list.
Click OK.
The service interface editor opens.
Expand Segment 1 and IVTNO_INPUT_MSG to see all
fields in the data structure.
The phone book service requires most of the fields for input messages, except IN_LL and IN_ZZ.
These are IMS internal fields.
Exclude IN_LL and IN_ZZ by clicking the check boxes in the Include
column to de-select them.
Figure 3. The service interface editor with the request service interface for the phonebook
service
Click File > Save to save the request service interface.
To define the service interface for the response message for the phone book
application:
Click the service.properties tab to go to the overview page of your
service project.
In the Define Request and Response Service Interfaces section, click
Create Service Interface.
Specify a name such as phonebookResponse for the service interface.
Click the button to import the phone book copybook.
Again, select where you are importing the phone book copybook from.
Select the file type. For this tutorial, the default of COBOL data structures
only is used.
For the Data structure file field, click Browse.
In the Select File dialog, navigate to the phone book copybook file
IMSPHBK.cpy on your workstation and click Open.
Specify the data structure for the output messages:
In the Data structure name list, select
IVTNO_OUTPUT_MSG.
For the Message name list,
<service_interface_name> is automatically
selected.
For the Segment name list, ensure that Segment 1
is selected.
Click Add to Import List to add this message data structure to the
Import list.
Click OK.
The service interface editor opens.
Expand Segment 1 and IVTNO_OUTPUT_MSG to see all
fields in the data structure.
The phonebook service requires most of the fields for output messages, except OUT_LL and OUT_ZZ. These are IMS internal fields. Exclude OUT_LL and OUT_ZZ by clicking the check boxes in the Include column to deselect them.
Save your changes.
You have created two service interface files. In the Project Explorer view, two service
interface files (.si files) are created in the
service-interfaces/ folder in your service project.
The next step is to go back to the service project editor to select this service
interface file as the request and response service interface for this project.
Go back to the Overview tab of your service project.
Select the service interface files that you created as the interface to use for the request and
the response.
For the Request service interface field, select the
.si file that you created for the request, for example,
phonebookRequest.si.
For the Response service interface field, select the
.si file that you created for the response, for example,
phonebookResponse.si.
Save your changes.
The final step is to enter the details of the required configuration for this
service.
Select the Configuration tab of your service project.
In the Connection profile: field, enter the ID value that is associated
with your imsmobile_imsConnection XML element in your
ims-connections.xml file, for example, Connection1_CF.
Your ims-connections.xml file is located under the
resources/imsmobile-config/connections directory for your server.
In the Interaction profile: field, enter the ID value that is associated
with your imsmobile_interaction XML element in your
ims-interactions.xml file, for example,
InteractionProperties1. Your ims-interactions.xml file is
located under the resources/imsmobile-config/interactions directory for your
server.
Save your changes.
Results
The IMS phonebook service is now ready to be
deployed.