In the previous steps you created and configured an enterprise server for dynamic debugging. You deployed to it the Web service supplied with the WebService demonstration and generated a client for it.
You created a Visual Studio project for the COBOL source program of the Web service.
Now if a client is invoked and the Web service is running you can debug the service by debugging its source in Visual Studio.
In this demonstration you:
- Insert a breakpoint in the COBOL source of the Web service.
- Rebuild the Visual Studio project.
- Start a debugging session in Visual Studio.
- Run the client in Net Express to start the service.
- You execute the service and debug it in Visual Studio.
Insert a Breakpoint in the COBOL Source
To introduce a breakpoint in the COBOL source of the Web service, the Calculator application:
- Open your Visual Studio project.
- In Solution Explorer, double-click the COBOL source, calculator.cbl.
The application opens in the code editor.
- Insert a breakpoint on the ADD statement in the Procedure Division.
To do this, double-click in the left margin of the ADD statement.
Rebuild the project
- Right-click the project in Solution Explorer.
- Select Rebuild from the context menu.
Start Debugging
To start a debugging session:
- Click Debug > Start Debugging.
Run the Client and Debug the Service
You run the client as follows:
- In the Net Express project window, right-click CalculatorDemo-app.int.
- Click Run.
- Click OK in the Start Animating dialog.
- In the Application output window, enter the address of the Web service and the port as stored under Listeners for WEBDEMO.
The format should be as follows: http://IPAddress:Port.
- Press Enter twice to skip entering a username and a password.
- On the Add.a line, type an arbitrary number.
- Press Enter.
- On the Add.b line, type another number.
- Press Enter.
At this point, the debugger hits the breakpoint in the COBOL source and Visual Studio opens and highlights the line of code that has a breakpoint.
Stop Debugging
When you have finished debugging, you need to end the debug session as follows:
- In Visual Studio, click Debug > Stop Debugging.