Previous Topic Next topic Print topic


Create a Visual Studio Project

You use Visual Studio to debug the source of the COBOL Web service deployed to Enterprise Server. That is why you need a Visual Studio project to hold the COBOL source of the service. You associate the project with the WEBDEMO enterprise server so when a client for the Web service starts, you can debug the service dynamically.

The following outlines the steps you perform in this topic:

  1. Create a Visual Studio project for the Calculator application, calculator.cbl, which is the source of the Web service you deployed to Enterprise Server.
  2. Specify properties for the project.
  3. Associate the project with your enterprise server, WEBDEMO.

Create a Visual Studio Project

To create a project to hold the COBOL source file from the demonstration program:

  1. Start Visual Studio.
  2. Click File > New > Project > COBOL Projects > Native > Mainframe Subsystem Application.
  3. Optionally, specify a name for your project such as Calculator.
  4. Optionally, specify a path to the project folder in Location.
  5. Click OK.
  6. Using Windows Explorer, copy calculator.cbl from from the subdirectory Examples\Visual Studio Integration\Tutorials\Calculator in your installation folder to your project directory.

Import the COBOL Source Program

To import the COBOL source program into your Visual Studio project:

  1. In Solution Explorer, right-click your project.
  2. Choose Add > Existing Item.
  3. Select calculator.cbl in your project directory.
  4. Click Add.

Specify Project Properties

To specify properties for the project:

  1. In Solution Explorer, double-click the Properties folder.
  2. On the COBOL tab, make sure that the “Non-mainframe” COBOL dialect is selected.
  3. On the Debug tab, select WebService in the Choose Active Setting.
  4. On the same tab, click the Web Services tab.
  5. Leave the Client IP Address field empty to allow debugging from any IP address.
  6. In the Service field, type the address of the Web service in the following format: http://tempuri.org/ServiceName#OperationName.

    In your case, you need to type the address of the service as it is displayed on the Services page of Enterprise Server Administration: http://tempuri.org/CalculatorDemo#Add.

  7. Click File > Save All to save the changes to the project properties.

Associate Your Project with Enterprise Server

You need to associate your Visual Studio project with the running WEBDEMO Enterprise Server to be able to debug the Web service deployed to it.

To associate the project:

  1. In Server Explorer, right-click Micro Focus Servers and choose Refresh.
  2. Right-click WEBDEMO and choose Associate with project > your project.

Build the Solution

To build the solution:

  1. Right-click the solution in Solution Explorer.
  2. Choose Build Solution from the context menu.

    Check the Output window to see if the solution built successfully.

Previous Topic Next topic Print topic