Hi Dojo,
I'm using the Class Library in my connector development to receive data from a remote element.
Since retrieving the data on this remote element can take a while, I want to avoid that my base element is locked due to this waiting.
Therefor I added as return address the local reference of my base element with PID 9000000. I'm sending this message without expecting a response. (That makes the base element to release waiting).
After the remote element is done with the query of the InterApp API, It will now push back the results to my base element. There I now created an Executor class for this "response"-message.
I'm getting an argument exception that the JSON is unable to deserialize, due to "Could not find type" ..... in assembly 'QAction_ClassLibrary, Version=2021.1005.649.32645, Culture=neutral, PublicKeyToken=null'
Note that the namespaces for the messages & executors are equal. The code is in separate files in a precompiled QAction_1.
Any help is welcome!
Hi Thijs,
From your description, I believe what is happening is a mix of 2 things
Your remote element is probably replying with an object of type Message and not IInterAppCall and most likely the QAction where you parse this is using something like
IInterAppCall interApp = InterAppCallFactory.CreateFromRaw(rawData);
This will try to create an IInterAppCall type to work around this you can send the response message as IInterAppCall as well or use the following code
Message message = MessageFactory.CreateFromRaw(rawData);
The second thing that could be causing you issues is that although the Message objects have the same namespaces in both connectors, the InterAppCallFactory could be having issues loading it in memory correctly or having some ambiguous reference
To work around this you can also try the following (IInterAppCall)
var myCustomSerializer = SerializerFactory.CreateInterAppSerializer(typeof(IInterAppCall), new List<Type>{typeof(Skyline.Protocol.IAC.MyCustomObjectMessage)});
var interApp = InterAppCallFactory.CreateFromRaw(rawData, myCustomSerializer);
Or (Message)
var myCustomSerializer = SerializerFactory.CreateInterAppSerializer(typeof(Message), new List<Type>{typeof(Skyline.Protocol.IAC.MyCustomObjectMessage)});
var message = MessageFactory.CreateFromRaw(rawData, myCustomSerializer);
Amazing! I tweaked the code on the remote element, to make sure if the Return Message is send as an external message, to send it via the IInterAppFactory as you suggested.
That way on my primary element, I’m now able to use the Executor to process the response similar as a “new request”.
Thanks for unblocking me in the development!