Skip to content

Tutorial 04 02 Add Traditional Bridge Project

mattl91 edited this page Feb 9, 2023 · 26 revisions

Harmony Core Logo

Tutorial 4: Adding a Traditional Bridge Project

This tutorial assumes that you have already followed the Building a Service from Scratch tutorial and that you have a 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 perhaps 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 needed parameters.
  • construct a suitable response message based on the return values and/or the value of any out parameters.
  • 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. 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 and in the same solution as the Harmony Core services. But remember that this is not always the case. The Traditional Bridge code could be built and run on Windows, UNIX, Linux, or OpenVMS.

Add a TraditionalBridge Project and Code

  1. Open a Windows command prompt and navigate to the directory with the .sln file for your Visual Studio solution.

  2. Enter the following command to open the Harmony Core GUI tool:

    harmonycore gui
    

    A message will briefly display indicating that the solution is being loaded.

  3. When the "Loading Solution" message disappears, select Features > Add Traditional Bridge from the menu.

    A message will indicate that Traditional Bridge is being added to the solution. When this process is finished, click OK to close the message, and select File > Quit from the menu to close the Harmony Core GUI tool.

Unless you have changed it, the .NET code in your solution may be defaulting to being built for Any CPU, and the TraditionalBridge project that you just added is probably defaulting to being built for x86 (32-bit). Though it's not an absolute requirement, we'll make sure the environment builds the code for x64 (64-bit):

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

    Configuration Manager

  2. Make sure the TraditionalBridge Platform is set to x64 and the checkbox in the Build column is selected.

  3. Change the Active solution configuration to Release, then once again make sure the TraditionalBridge Platform is set to x64.

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

Your solution now has the basic scaffolding for Traditional Bridge.


Next topic: Add Traditional Bridge Library Code


Clone this wiki locally