Hi everybody
I am currently facing a problem when trying to serialize RemObjects Entities containing a Binary.
new JavaScriptSerializer().Serialize(new TPerson {
Signature = new RemObjects.SDK.Types.Binary(“Bli-blah-blubb”)
});
This raises a System.InvalidOperationException: Timeouts are not supported on this stream.
Further examination revealed that this is caused by the ReadTimeout Property of the RemObjects.SDK.Types.Binary class.
Is this a known issue. I think, RemObjects entities should be implemented in a fashion that they can be serialized by the supported languages and their libraries.
They are. The BinaryFormatter (and other generic.NET serializers) serialize Binary objects.
However JavaScriptSerializer (and its more advanced variation from Newtonsoft) do not work with MemoryStream and any objects based on it. They do not care to serialize Stream contents and thus are useless in your case.
You need to change the data field type from Binary to Byte and then do something like
new JavaScriptSerializer().Serialize(new TPerson {
Signature = new RemObjects.SDK.Types.Binary("Bli-blah-blubb").ToArray()
});
Hmm…
The Datatype is defined in the RODL as Binary and I cannot see a byte array type in the Remobjects Service Builder.
Does this mean, I cannot convert a RODL Entity to Json out of the box?