-
Notifications
You must be signed in to change notification settings - Fork 79
Description
When I extend a CFX message and it arrives in an application which does not know this extended message, it will never arrive. It would be good that if this extended message is not known, it will deserialize the one of base classes which is a standard CFX message.
Example I have extended the ValidateUnitsRequest in the class ValidateUnitsRequestExt
In Json, you can find this type:
"$type": "MyNamespace.ValidateUnitsRequestExt, MyAssembly"
The Json deserializer will fail deserializing this string because the ValidateUnitsRequestExt is not know in this application.
Solution:
Add base class info in the message:
"$type": "MyNamespace.ValidateUnitsRequestExt, MyAssembly",
"$baseTypes": [
"CFX.InformationSystem.UnitValidation.ValidateUnitsRequest, CFX"
],
...
$baseTypes is a custom property which has to be added.
If the deserialization fails, it can check if one of the base classes is a standard CFX message, and if so serialize it to the base class.
This should solve a lot of our problems. We have to keep sender and receiver in sync according message types sent. But this is not always easy.