Guides you through the process of adding the operations that enable the ACCTWS Web service to interact with the ACCT application.
Each service interface you create is comprised of a set of operations. For a CICS Screen service interface, each operation
addresses a screen encountered by the application. In this section of the tutorial, you define three operations that enable
users to retrieve and display the account information you provided earlier in this tutorial when interacting with the ACCT
application. You also define an operation to handle error conditions.
Tip: As you define these operations, we recommend that you save your work periodically. You can do this at any point you choose
and as often as you like by clicking
File > Save ACCTWS.svi from the Visual Studio menu.
Define the Start operation
The purpose of the Start operation is to connect to the ACCT application.
- In the
Interface Mapper, right-click the
Operation button, and then select
New from the context menu.
- In the
Operation Name field, type
Start.
- Leave the default values in the
Active Screen and
Previous Screen fields.
- In the
Transaction ID field, type
ACCT.
- Click
OK.
Define the Send Request operation
The Send Request operation interacts with the ACCT application, automatically setting the request type to
D (Display), and provides a means for a user to enter the account number of the record to be displayed.
- Create the Send Request operation
-
- Right-click the
Operation button, and then select
New from the context menu.
- In the
Operation Name field, type
Send Request.
- From the
Active Screen drop-down list, click
ACCTSET.ACCTMNU.
This is the name defined in the
acctset.bms map for the
ACCOUNT FILE: MENU screen, which is the initial screen called when the ACCT application starts.
- Leave the default value,
ANY SCREEN, in the
Previous Screen field.
- Leave the
Transaction ID field blank. This operation does not start a transaction.
- Leave
Create Default Mappings unchecked.
- Click
OK.
This returns you to the
Interface Mapper and renders the ACCTSET.ACCTMNU screen in the
CICS Screen pane.
- Assign a value to the REQUEST TYPE input field
- As you learned from running this application in its original form, if you want to display account information, you need to
provide the application with a
D (for Display) in the
REQUEST TYPE screen field. Rather than requiring the user to enter the request type value manually, you create an assignment to provide
the value automatically.
- On the
CICS Screen pane, hover over the input field next to the
REQUEST TYPE label. Note that the name of the input field is
REQM.
Note: If the screen rendering is too small, resize it by grabbing and pulling on the perimeter.
- In the
Assignments pane, right-click and select
New Assignment from the context menu.
Note: The
Assignments pane is located below the
Mappings pane. If you cannot see the
Assignments pane, drag the bottom of the
Mappings pane upwards until it appears.
- From the
Assign to drop-down list, select
REQM.
- In the
Field 1/Operand 1 field, type
D, which is the value that tells the application to display information.
- Click
OK.
- Map the ACCOUNT input field to an interface field
- Instead of assigning a value for the account number, you can enable users to enter an account number manually by mapping the
ACCOUNT input field to an interface field.
- On the
CICS Screen pane, identify the name of the input field for
ACCOUNT by hovering over the field. Note that the name of this input field is
ACCTM.
- Click and drag the
ACCTM field to the
Interface Fields pane and drop it there.
The interface mapper creates a new interface field named
ACCTM.
When you eventually generate a client for a service interface, the name of each interface field is used as a label for the
corresponding input field on the client UI.
The name
ACCTM does not adequately convey the purpose of the field to an end user. Therefore, you need to rename it to be easily recognized
as the input field for the account number.
- In the
Interface Fields pane, double-click
ACCTM.
- In the
Name field, type
AccountNumber.
The other fields on this dialog box are accurate so no additional adjusting is necessary here.
- Click
OK.
Notice that the
Mappings pane shows the interface field with its new name,
AccountNumber, mapping to the COBOL field
ACCTM.
- Assign the
Enter key to send values to the application
- You need to define an AID key (for example,
Enter) that the user can push to send the provided input values to the application.
- In the
Assignments pane, right-click and select
New Assignment from the context menu.
- From the
Assign to drop-down list, click
ATTENTION ID.
This is the field that defines which AID key to use.
- From the
Field 1/Operand 1 drop-down list, click
ENTER.
- Click
OK.
Define the Display Account Data operation
The Display Account Data operation retrieves the requested account information and displays it in the client UI.
- Create the Display Account Data operation
-
- Right-click the
Operation button, and then select
New from the context menu.
- In the
Operation Name field, type
Display Account Data.
- From the
Active Screen drop-down list, click
ACCTSET.ACCTDTL.
This is the name defined in the
acctset.bms map for the
ACCOUNT FILE: RECORD DISPLAY screen, which is the screen called when the user sends a request.
- In the
Previous Screen field, leave the default value of
ANY SCREEN because in this service interface, the ACCTSET.ACCTDTL screen is used only once.
- Leave the
Transaction ID field blank. This operation does not start a transaction.
- Leave
Create Default Mappings unchecked.
- Click
OK.
This returns you to the
Interface Mapper and renders the
ACCTSET.ACCCDTL screen in the
CICS Screen pane.
- Create interface fields
- You need to identify the fields on the
ACCTSET.ACCTDTL screen that contain the information you want to return to the user. For this service interface, you want to return the account
number, last name, first name, and the first two address fields.
- Drag and drop the corresponding output field for each of the following field labels on the
ACCTSET.ACCCDTL screen from the rendered screen to the
Interface Fields pane:
- Hover over the output fields associated with the
ADDRESS label and identify the
ADDR1D and
ADDR2D output fields.
- Drag and drop the identified output fields from the rendered screen to the
Interface Fields pane.
- Redefine the interface fields
- As with the interface field in the Send Request operation, you need to rename each of these interface fields to something
more meaningful for the end user. In addition, the default direction assigned to each new interface field is
Input; however, because these function as output fields in the client UI, you need to change the direction for each to
Output.
Perform the following steps for each interface field:
- Double-click an entry on the
Interface Fields list.
- On the
Field Properties dialog box, type a new name as indicated in the table:
Name
|
New Name
|
SNAMED
|
LastName
|
FNAMED
|
FirstName
|
TELD
|
Telephone
|
ADDR1D
|
Address1
|
ADDR2D
|
Address2
|
- Change the direction by selecting the
Output radio button.
- Click
OK.
Define the On Error operation
You need to define an operation that returns an ACCT application error message if something goes wrong during the execution
of your Web service. For example, if an end user provides an invalid account number, the ACCT application cannot retrieve
the requested data, and sends an error message instead.
- Create the On Error operation
-
- Right-click the
Operation button, and then select
New from the context menu.
- In the
Operation Name field, type
On Error.
- From the
Active Screen drop-down list, click
ACCTSET.ACCTMNU.
- From the
Previous Screen drop-down list, click
ACCTSET.ACCTMNU. This sets the operation to execute if the application sends a second consecutive
ACCTSET.ACCTMNU screen, indicating an error in processing the input.
- Leave the
Transaction ID field blank. This operation does not start a transaction.
- Leave
Create Default Mappings unchecked.
- Click
OK.
The
CICS Screen pane now shows the
ACCTSET.ACCTMNU screen.
- Create an interface field
- You need to identify the field that the ACCT application uses to send error messages, and then create an interface field to
display its output.
- On the
ACCTSET.ACCTMNU screen, hover over the bottom-most field.
As you can see in the popup, the name of this field is
MSGM. It is the output field for ACCT application messages.
- Drag the
MSGM field from the rendered screen to the
Interface Fields pane and drop it there.
- In the
Interface Fields pane, double-click
MSGM and change its name to
ErrorMsg and its direction to
Output.
Note: It seems logical to name this output field
Message. However, MESSAGE is a COBOL reserved word, and the
Interface Mapper does not allow COBOL reserved words to be used as names for interface fields.
Save and close the
Interface Mapper
You have now defined all of the required operations for your CICS Screen service interface. Before proceeding, be sure you
have saved your work, and then close the
Interface Mapper:
- From the Visual Studio main menu, click
File > Save ACCTWS.svi.
- Click the
x on the
ACCTWS.svi tab to close the
Interface Mapper.