Previous Topic Next topic Print topic


Debug the Web Service

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:

  1. Insert a breakpoint in the COBOL source of the Web service.
  2. Rebuild the Visual Studio project.
  3. Start a debugging session in Visual Studio.
  4. Run the client in Net Express to start the service.
  5. 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:

  1. Open your Visual Studio project.
  2. In Solution Explorer, double-click the COBOL source, calculator.cbl.

    The application opens in the code editor.

  3. 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

  1. Right-click the project in Solution Explorer.
  2. Select Rebuild from the context menu.

Start Debugging

To start a debugging session:

  1. Click Debug > Start Debugging.

Run the Client and Debug the Service

You run the client as follows:

  1. In the Net Express project window, right-click CalculatorDemo-app.int.
  2. Click Run.
  3. Click OK in the Start Animating dialog.
  4. 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.

  5. Press Enter twice to skip entering a username and a password.
  6. On the Add.a line, type an arbitrary number.
  7. Press Enter.
  8. On the Add.b line, type another number.
  9. 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:

  1. In Visual Studio, click Debug > Stop Debugging.
Previous Topic Next topic Print topic