Walks you through the process of creating a debug configuration for your new service, and running the client application to access the service.
Restriction: This topic applies to Windows environments (local development) only.
Create a Debug Configuration
- In the COBOL Explorer, click the
ProgramREST project.
- From the main menu, click
Run > Debug Configurations.
- In the left pane, right-click
COBOL Enterprise Server; then select
New from the context menu.
- On the
General tab, in the
Name field, type
ProgramREST.
- Click the
Browse button that corresponds to the
Connection and
Server fields.
- Select
ESDEMO; then click
OK.
Note: If the ESDEMO
enterprise server region is the only region defined in
Enterprise Server, these fields are completed for you.
- Under
Debugging type, click the
Web Service tab.
This shows that all debug Web services are invoked by a request from the client.
- Click
Apply; then click
Debug.
- Answer
Yes to any prompts to open perspectives.
- In the Debug perspective, you should now see an entry for debugging
ProgramREST [COBOL Enterprise Server].
Set Breakpoints
You want to be able to see when the client program hands off control to the service running in
Enterprise Server. Because the program hands off control at two points in its execution, first to run the MakeAppt operation, and second to run the CheckAppt operation, you set a breakpoint at each hand-off point in the code so you can step through the program.
The code that calls the service is contained in the
ProgramREST-proxy.cbl file:
call "InvokeService02"
It appears twice in the program. You want to set a breakpoint just before each of these call statements.
- From the COBOL Explorer, expand
ProgramRest > COBOL Programs > client.
- Double-click
ProgramREST-proxy.cbl. This places the source code into the COBOL editor.
- Scroll down to line 424:
move 256 to wsc-srvc-faultcode-len
- Place your mouse pointer in the left-most column of line 424 and double-click to set a breakpoint.
- Scroll to line 522:
move 256 to wsc-srvc-faultcode-len
- Set a breakpoint.
Run the COBOL Client
- From the COBOL Explorer, expand
ProgramRest > COBOL Programs > client.
- Right-click
ProgramREST-app.cbl; then select
Debug As > COBOL Application from the context menu.
This places an entry into the Debug perspective for the client application.
- In the Debug perspective, right-click the bottom-most entry; then select
Resume.
- The client invokes a console named
runm, and waits for input. Complete the fields as follows to set an appointment slot:
Service Address
|
leave blank
|
Username
|
leave blank
|
Password
|
leave blank
|
Operation
|
1
|
lnk_customer_name
|
Benton Riley
|
lnk_consultant_id
|
8706
|
lnk_date.lnk_yyyy
|
2525
|
lnk_date.lnk_mm
|
1
|
lnk_date.lnk_dd
|
1
|
lnk_time_slot
|
5
|
The client application then resumes execution, and pauses on the
move 256 to wsc-srvc-faultcode-len statement.
- Switch back to the
Debug perspective.
- Press
F6 multiple times to step through the code until you have stepped just past the
call "InvokeService02" statement.
- On the
Debug perspective, expand entries under all COBOL Thread entries. You should see that the deployed
schedule application is now being accessed from
Enterprise Server.
- Press
F8 to resume and terminate execution.
Rerun the COBOL Client
Here you rerun the client, selecting the other operation to see that the appointment has been made.
- In the
Debug perspective, right-click the
ProgramREST-app.dll entry marked as <terminated>; then select
Relaunch from the context menu.
- In the
Debug perspective, right-click the bottom-most entry; then select
Resume.
- Complete the
runm fields as follows:
Service Address
|
leave blank
|
Username
|
leave blank
|
Password
|
leave blank
|
Operation
|
2
|
lnk_customer_name
|
Benton Riley
|
lnk_consultant_id
|
8706
|
lnk_date.lnk_yyyy
|
2525
|
lnk_date.lnk_mm
|
1
|
lnk_date.lnk_dd
|
1
|
The client application then resumes execution, and pauses on the
move 256 to wsc-srvc-faultcode-len statement.
- Press
F6 multiple times to step through the code until the appointment you set appears on the list in the
runm client. You should see it on line
[00005] because it is the fifth appointment set for that day.
- From the
Debug perspective, press
F8 to resume and terminate execution.