Skip to content

Tutorial 04 02 Add Traditional Bridge Project

Steve Ives edited this page May 27, 2020 · 26 revisions

Harmony Core Logo

Add a Traditional Bridge Project

This tutorial assumes that you have already followed the Building a Service From Scratch tutorial, and have an existing and working Harmony Core service that does not include a Traditional Bridge environment.

Adding Traditional Bridge to an existing solution typically involves adding a new traditional Synergy project to the solution, as well as adding code into several of the existing .NET projects in the solution, specifically the Services and Services.Controllers projects, and maybe also the Services.Models project.

On the traditional Synergy side, a Traditional Bridge environment is usually implemented within a simple console application (DBR) that we refer to as the Traditional Bridge host program. But you might also choose to organize and deploy some of the code via additional ELB projects, it really depends on how complex your environment is.

The Traditional Bridge host program will:

  • Listen for request messages from Harmony Core, sent via standard in (TT:).
  • Decode requests to determine which routine is to be called, and to determine values for any inbound parameters.
  • Execute subroutines and functions as directed, passing all appropriate parameters.
  • Based on the return values and.or the value of any out parameters, construct an appropriate response message.
  • Send the response back to Harmony Core via standard out (TT:).

The format of the request and response messages is defined by a standard protocol called JSON RPC 2.0, and this mechanism is described in more detail in the Dynamic Call Protocol topic.

In this tutorial, the Traditional Bridge environment will be implemented on Windows, in the same solution as the Harmony Core services, but remember that in some cases this will not be the case. The Traditional Bridge code could be built and run on Windows, UNIX, Linux, or OpenVMS.

Open Your Solution

  1. Start Visual Studio and open the Harmony Core solution that you want to add a Traditional Bridge environment to.

Add a TraditionalBridge Project

  1. In Solution Explorer, right-click on the main solution then select Add > New Project....

  2. At the top of the Add New Project dialog, enter Synergy DBR in the search box, then locate and select the project template named Traditional Application (DBR).

  3. Click the Next button.

  4. In the Project name field, enter TraditionalBridge.

  5. Press the Create button to create the new project and add it to the solution.

You will notice that a sample program named Program.dbl has been included in the new project. There is no rule for what a Traditional Bridge host program should be named, but we suggest TraditionalBridgeHost.

  1. In Solution Explorer, in the new TraditionalBridge project, right-click on the Program.dbl, select Rename, and change the name of the file to TraditionalBridgeHost.dbl.

  2. Although not absolutely required, open the source file and add the name TraditionalBridgeHost to the main compiler directive also.

You also need to make sure that the Visual Studio build system produces a DBR with the same name, because by default the name of the project file will be used.

  1. In Solution Explorer, right-click on the TraditionalBridge project, then go to the Application tab, change the value of the Output name field to TraditionalBrisgeHost, then save and close the project properties dialog.

Unless you have changed it, the .NET code in your solution is probably defaulting to being built for Any CPU, and the new TraditionalBridge project that you just added is probable defaulting to being built for x86 (32-bit). Again, not an absolute requirement, but we'll change the environment to build the code for x64 (64-bit).

  1. In Solution Explorer, right-click on the main solution and select , Configuration Manager....

    Configuration Manager

  2. Change the TraditionalBridge Platform to x64 and check the option in the Build column.

  3. Click the Close button to save your changes and close the dialog.

Build the Code

Before we move on, let's make sure the project builds:

  1. Right-click on the TraditionalBridge project and select Build.

  2. Check the Output window and verify that the build was successful.

    1>------ Build started: Project: TraditionalBridge, Configuration: Debug x64 ------
    ========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
    

Next topic: Add Traditional Bridge Library Code


Clone this wiki locally