Set Up the OOSqlBookWCF Solution

Takes you through the steps required to set up the OOSqlBookWCF Visual Studio solution used in this tutorial.

Create the OOSqlBookWCF solution and project

  1. In Visual Studio, click File > New > Project.
  2. In the New Project dialog box, expand Installed > COBOL.
  3. Click the Windows Desktop category.
  4. In the center pane, select WCF Service Library.
  5. Complete the fields as follows:
    Name OOSqlBookWCF
    Location c:\tutorials\SQL
    Solution Name OOSqlBookWCF
    Framework Choose the appropriate .NET Framework version from the drop-down list.
    Note: Must be version 4.5 or later.
  6. Uncheck Create directory for solution.
  7. Click OK.

Add existing projects

We provide the OOSqlBookWrapper and OOSqlLegacyBook projects for you to add to the solution. These contain application source code and references.

  1. In the Solution Explorer, right-click the solution; then select Add > Existing Project.
  2. Browse to the %PUBLIC%\Documents\Micro Focus\Visual COBOL\Samples\SQL\ado.net\OOSqlBookWrapper directory.
  3. Double-click the OOSqlBookWrapper COBOL project.
  4. Again, in the Solution Explorer, right-click the solution; then select Add > Existing Project.
  5. Browse to the %PUBLIC%\Documents\Micro Focus\Visual COBOL\Samples\SQL\ado.net\OOSqlLegacyBook directory.
  6. Double-click the OOSqlLegacyBook COBOL project.

Add project references

The two projects you just added to the solution need to be incorporated by reference. Here you create a reference from the OOSqlBookWCF project to the OOSqlBookWrapper and OOSqlLegacyBook projects.

  1. In the Solution Explorer, right-click the OOSqlBookWCF project; then select Add > Reference.
  2. In the left pane, click Projects.
  3. In the right pane, check OOSqlBookWrapper and OOSqlLegacyBook; then click OK.

Replace generated components

When you created the OOSqlBookWCF project, it generated some default configuration and source code files. We have provided updated files to replace these:

  1. In the Solution Explorer, delete the app.config, IService1.cbl, and Service1.cbl files from the OOSqlBookWCF project.
  2. Right-click the project; then select Add > Existing Item.
  3. On the Add Existing Item dialog box, select All Files (*.*) from the Filename filter drop-down list.
  4. Browse to the %PUBLIC%\Documents\Micro Focus\Visual COBOL\Samples\SQL\ado.net\OOSqlBookDemoWCF\OOSqlBookWCF directory.
  5. Select the following files:
    • app.config
    • ISqlBook.cbl
    • SqlBookService.cbl
  6. Click Add.

Build the solution

  • In the Solution Explorer, right-click the OOSqlBookWCF solution; then select Build Solution from the context menu.