Skip to content

Tutorial 04 11 Test Traditional Bridge

Matt Linder edited this page Jun 30, 2023 · 12 revisions

Harmony Core Logo

Tutorial 4: Testing Traditional Bridge

You now have all the pieces in place for a working Traditional Bridge implementation. You should now be able to start your service and test the new endpoints that are associated with your Traditional Bridge functions.

Start the Service and Postman

  1. In Visual Studio, press F5 (Start Debugging) to start the self-hosting application. You should see the console window appear, with messages confirming that your service is running.

  2. Start the Postman utility.

Obtain an Access Token

If you do not have custom authentication implemented in your service (see Tutorial 3: Authentication via Custom Code), skip to the next section.

  1. In Postman, use your Get Token request (created in Tutorial 3: Authentication via Custom Code) to obtain a valid JSON Web Token (JWT).

Create a new Postman Collection

  1. In Postman, create a new collection named Traditional Bridge Tests.

  2. Select the Traditional Bridge Tests collection by clicking it. Then, in the tab that opens, select the Authorization tab, set Type to Bearer Token, and paste the JWT into the Token field.

  3. Go to the Variables tab, create a new variable ServerBaseUrl and set it to https://localhost:8086.

    Variables tab

  4. Save the collection by pressing Ctrl+S

Test GetEnvironment

  1. Right-click the Traditional Bridge Tests collection, select Add Request, and set Request name to GetEnvironment.

  2. Set the URL to {{ServerBaseUrl}}/BridgeMethods/GetEnvironment, and make sure the dropdown to the left of the URL is set to GET.

    GetEnvironment URL

  3. Click Save and then click the big blue Send button.

If all is well, you should see an HTTP 200 OK response, and the response body should contain something like this:

DBL/MS-WINDOWS Version 12.1.1

Test GetLogicalName

  1. Right-click the Traditional Bridge Tests collection, select Add Request, and set Request name to GetLogicalName.

  2. Set the URL to {{ServerBaseUrl}}/BridgeMethods/GetLogicalName, and in the dropdown to the left of the URL, select POST.

  3. Under the URL, select Body, Raw, and JSON. Then, in the pane below those settings, add the following JSON code:

{
    "aLogicalName":"DBLDIR"
}

GetLogicalName body

  1. Click Save and then click the big blue Send button.

You should see an HTTP 200 OK response, and the response body should contain something like this:

C:\Program Files\Synergex\SynergyDE\dbl

Test AddTwoNumbers

  1. Right-click the Traditional Bridge Tests collection, select Add Request, and set Request name to AddTwoNumbers.

  2. Set the URL to {{ServerBaseUrl}}/BridgeMethods/AddTwoNumbers and select POST in the dropdown to the left of the URL.

  3. Under the URL, select Body, Raw, and JSON. Then, in the pane below the Raw and JSON settings, add the following JSON code:

 {
     "number1":1.1,
     "number2":2.2
 }
  1. Click Save and then click the big blue Send button.

    If all is well, you should see an HTTP 200 OK response, and the response body should contain something like this:

    {
        "result": 3.3000000000
    }
    

That's it! You have successfully implemented and tested a Harmony Core Traditional Bridge environment.

Clone this wiki locally