How can we transparently serialize Dataset ExtendedProperties in WCF?

We are moving from Remoting to WCF a very large application that heavily uses DataSets. We use the ExtendedProperties of the DataSets tables to store a graph of objects containing special information that we need on the client side.

In our Remoting implementation, we added client and server channels to the channel stack to check if the message contains a data set and use the xml serializer to send ExtendedProperties via wire (you may know that the data set serializer makes ToString () of the elements found in ExtendedProperties).

We made it transparent to business rules and UI developers.

What should we redefine or implement in WCF in order to be able to manage the DataSet before it is serialized in xml / soap over the wcf channel? Is it possible?

Note. . I already know that we need to avoid using datasets in wcf, but we have more than 200 forms using datasets and changing them is not now.

Many thanks!

+3
source share
3 answers

Interestingly, if you cannot change the serializer by adding a behavior attribute at each end ... given the XmlReader/ XmlWriter, approach:

dataset.WriteXml(xmlWriter, XmlWriteMode.WriteSchema);

and

dataset.ReadXml(xmlReader, XmlReadMode.ReadSchema);

, (.. ), , DataSet - (attribute | serializer) - , , . , , ...

+2

NetDataContractSerializer. .NET, ISerializable, .

, WCF .NET.

+1
+1

Source: https://habr.com/ru/post/1708349/


All Articles