I am new in computer science (so hopefully I am using the right words and give the right information to answer this question), hopefully you guys can help me. I want to automatically transfer (JSON) data between two .NET Solutions.
I have two Solutions in .NET:
The Bot Framework SDK - Build in .NET Core 2.2 (https://docs.microsoft.com/en-us/azure/bot-service/dotnet/bot-builder-dotnet-sdk-quickstart?view=azure-bot-service-4.0)
The Qlik Sense .Net SDK. - build in .NET Framework 4.5.2 (https://github.com/kolsrud/qlik-dot-net-sdk-hypercube-usage)
I want to let these two solutions communicate with each other.
On the one hand: in the QlikSense.NET SDK we store all the data into a variable (let's say variable 'Sales', holding JSON data), if this variable is updated, I want to transfer it to the Bot framework (and store the data here).
On the other hand: we have a variable in the Bot Framework (let's say variable 'Query', holding JSON data), if that variable is updated, I want to pass it to the Qliksense SDK.
Summarized: I want to automatically transfer (JSON) data between the Qliksense SDK and the Bot framework SDK. How can I do that?
Again, sorry if something is unclear. Thanks in advance for you help! Appreciated!
Edit 1:
What have I tried? As asked by Selvin:
The only thing that I could come up with, was writing the JSON variable into a text file, and read that Text file from the other script. But, I don't think that this is a proper 'solution'.
There are a few solutions, which you can apply depending on details in your projects.
As I understand you are using Bot framework SDK without anything more. The base Nuget is written in .NET Standard 2.0, which can be used both in dotNet Core and dotNet Framework. So the easiest way is to upgrade/change your project to compile on dotNet Framework instead of dotNet Core. Then you can reference the second project without any problems.
If there are more compilations which I don't know you can do one of the following solutions:
This answer assumes ( as I can not discern any such details from the question ) that you already have your applications communicating, and are able to serialize and deserialize JSON and what you desire assistance with is the automatic sending of data on object update.
By using c#'s class mechanisms, you can - make sure your "Sales" variable is only updated via your publicly displayed update method - the publicly displayed update method also sends the new data to your other application
class SalesContainer
{
private string _sales;
public string getSales()
{
return _sales;
}
public string updateSales (string sales)
{
_sales = sales;
sendData(sales);
}
private sendData(string json)
{
// your sending logic here
}
}
Alternatively, you can look a bit into operator overload to allow you to makes less changes on your existing codebase.
I understand you have two applications. They cann't communicate with each other directly. You need a third-party mediation. A file, database, network stream, or MemoryMappedFile. QlikSense.NET application push update to mediation, and Bot Framework application read the update from mediation.
I think this is cross-process communication problemn, so each cross-process communication solution is feasible.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With