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:
- Create a Visual Studio project for the Calculator application, calculator.cbl, which is the source of the Web service you deployed to Enterprise Server.
- Specify properties for the project.
- 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:
- Start Visual Studio.
- Click File > New > Project > COBOL Projects > Native > Mainframe Subsystem Application.
- Optionally, specify a name for your project such as Calculator.
- Optionally, specify a path to the project folder in Location.
- Click OK.
- 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:
- In Solution Explorer, right-click your project.
- Choose Add > Existing Item.
- Select calculator.cbl in your project directory.
- Click Add.
Specify Project Properties
To specify properties for the project:
- In Solution Explorer, double-click the Properties folder.
- On the COBOL tab, make sure that the “Non-mainframe” COBOL dialect is selected.
- On the Debug tab, select WebService in the Choose Active Setting.
- On the same tab, click the Web Services tab.
- Leave the Client IP Address field empty to allow debugging from any IP address.
- 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.
- 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:
- In Server Explorer, right-click Micro Focus Servers and choose Refresh.
- Right-click WEBDEMO and choose Associate with project > your project.
Build the Solution
To build the solution:
- Right-click the solution in Solution Explorer.
- Choose Build Solution from the context menu.
Check the Output window to see if the solution built successfully.