Skip to main content

.NET: Integrating freestanding native apps with the .NET adapter

Most times, Finsemble launches your apps as part of your smart desktop. But there could be some apps that Finsemble can't or shouldn't launch. We call apps launched outside of Finsemble freestanding apps. The freestanding apps can be HTML or native. In this topic, we focus on the native freestanding apps. If you want to integrate freestanding HTML apps, see Integrating freestanding web apps with the JavaScript adapter.

A typical freestanding native app is a proprietary app that takes a long time to load. Often, companies use freestanding native apps when they want to use a large legacy app with Finsemble. Examples include order management, execution management, or portfolio management. These apps are often large and typically perform multiple functions. They are relicts from the time when integration was difficult, and so people used monolithic apps to perform multiple interconnected tasks. The software development methodologies moved on from that old idea to smaller components that focus on a single purpose, but old apps still exist in many orgs. Most of these use .NET framework. Many companies are reluctant to get rid of these old apps, and they are too expensive to modify. So companies use them, and want them to participate in FDC3 interop. This is why we the need an adapter.

While you can write your own adapter, we already have one available for you.

note

Some advanced Finsemble features, including window-client operations and persisting app state across restarts or workspace reloads, are not currently supported for the native adapter.

Installing the .NET adapter

info

Before you begin, make sure that you have Visual Studio installed on your computer.

You can download the .NET adapter from NuGet. You install it by using the “Manage NuGet packages…” menu item of the Manage NuGet packages utility in Visual Studio:

Manage NuGet packages

For more info, see Install and manage packages in Visual Studio using the NuGet Package Manager. Unlike with the JavaScript adapter, where you could use a preload to load it, preloads aren’t available for native apps.

note

Currently there is no way to load the adapter dynamically.

Configuring the adapter

There are some optional arguments that you can specify for your adapter. To do this, you use the string array of arguments called args. The arguments that you can specify are:

  • finsembleWindowName - (optional) You can give your app a specific window name. This name will appear in log messages. If you don't specify this parameter, Finsemble generates one for you. This argument is analogous to the windowName property of the JavaScript adapter.
  • serverAddress - (optional) You can provide a url for Finsemble's IAC. The default is ws://127.0.0.1:3376. You can configure this address by setting the finsemble.router.transportSettings.FinsembleTransport.serverAddress property in your manifest file, for example public/configs/application/manifest-local.json. This argument is analogous to the routerAddress property of the JavaScript adapter.

Using the adapter

Before your users can use a freestanding app, Finsemble needs to authenticate it. To achieve this, an app needs to provide 2 parameters to FSBL.Connect. The first argument is the appId for the application and the second argument is a JsonWebKey object. Here is an example:

var FSBL = new Finsemble(args, this); 
FSBL.Connected += Finsemble_Connected;
FSBL.Connect("Finsemble WPF Demo", JWK);

private static void Finsemble_Connected(object sender, EventArgs e)
{
var context = new Context(new JObject
{
["type"] = "fdc3.instrument",
["name"] = DataToSend.TextBox.Text,
["id"] = new JObject
{
["ticker"] = DataToSend.TextBox.Text
}
});

FSBL.FDC3Client.DesktopAgentClient.Broadcast(context);
}

The JsonWebKey looks similar to this:

JsonWebKey JWK = new JsonWebKey()
{
D = "S7msrBKYM_VhXmAWTLhoRobLTevToYbX3xkbkN-EiaZ6Hg-xfozn5uAQGnBnoP1ldKOgoj5Z3dx6kTgR-3xfonEfdkk6wn0OVNbuFYyGkeeV4ts5JmyVpihFqE3RbkWuQ5D5xpIhXWl1fOWEuFfGCYIib2pmBUyc4Lz4OYmMOIGEC9nJg6ZuoKOh0nDZBjjO6vbYbXCEi0ys-FD7NAWsM8jTNDxLyXmpCNSVJOnGTX9CcxnFGdLVO8fqbooaydSHtFJE9YVqUKWp54hOBFMHdsTY5iT88urrvdBLxtGf6NGUVetpw-nFiOihDRPb9wMuLY9CT4DDzLecxadrLKh0PQ",
DP = "dw8tnJQEpXazaYFcOhCvlU0Y4kGiul1W-_MTCXml8njCEx0Gp4s8jWf_QK7PcdzZRl-t_NTu12i2UGn8lCvOrSc4g66OkwZxPCVuvGXqQQ2DHTgFR2vk-Q53cFrMtjo8FvplkQuf92vS58ulq-iogDp7xxxXTAhmWaPA_d2i3C0",
DQ = "EffO_SIA7qpBsSDHDKN3TdgybckYjN738roGKcU23ZXDDRy8h9X_lYtMSvjBQz7CRdia7F7aXGJLS08LSAfajRH-W8ssYfRge3twkrqxDXspWwIb77eMSINUUzRA1QQD7kSs_-LsU-rujsqZa-dnBxWhareFtVM-957lkzp4lTU",
E = "AQAB",
N = "zPOxYfLiAd3rM7KOLDBIeLl0kjQ7fk43mTTc1Nm9BDaSNVWqvOshSMCHmqOrKZX_WwA67Y6CQxWI5rZ6WNzoLHQU3PyqOvAdB7RgXCHlSeVYZ2haTcbWRjAXQ89H1WfnW96VwAbZn5nccxQGYlZIl3AMcwNRqV4hmiKtJVq4-2OzA-zs9Yg4Pfs6TbKR1XbNKz6EAPHDev0-7Xdnb6x1-qr4uL2Bq0ZwgfnyKQIRLc3zhD5kwqiJ5N7uZAZomLRkMFMXwy1UftD6fQUlFT2yoISn403RwN7YHEL8KoA9X7Jgs-dtlBh8c38QzQ1vbdMBzPuyRb07GMMKb6bdjdBV1w",
P = "6RJ2697p-SS6CIJYdDU8AxgyKHx3kMkHnFzLQakoi1h6UUNxb-r8v1PUU5xZA5ijmvJv9Ag5uIOhT3u3vSOkADqGsqctNGtFf60hbjnkMDQnDNr2b-1_ayCn2pQM6mmisASfcnOJKUag4tLw3weK-t5uN9KYqfDBU7fVjqnq8HM",
Q = "4R0RUlCnmZRzEw9sqjwxMuvNM1BTSubvMvG0VIlBkYbCn9MOdwurBPxrYqnUcbw-q-qzQy6st6a4L-EAZSnfD3FEEFKeINOJK06l0EwjcLeP8B4YQ-bxd9UroXpl9ACiMqHzyvJCNOpw8A22nbjKVnVhW1E17F-LFAJoWBetYA0",
QI = "PODgpJrXxPAp72v_O0fNfAhWjHLeTk9TfLARl9lzPpYIoYR5tgP1Y_A-3feH_xtCfkzcCskfXIerQlY9lVmqs-eGEYjfuuPVYIruN4OsskMY1nz-h_14clyUmUwfCQJDV4qjcAzf80IMu53jYEW1BydRf90snRjk1dYgSq_qtTQ",
};

note

If your freestanding app doesn't interact with other apps that require it to be authenticated, you don't need to authenticate your app.

See also

Install and manage packages in Visual Studio using the NuGet Package Manager

Integrating freestanding web apps with the JavaScript adapter

.NET adapter