netdatacontractserializer

C# DataContract Serialization, how to deserialize to already existing instance

て烟熏妆下的殇ゞ 提交于 2019-11-28 23:59:04
I have a class, which holds a static dictionary of all existing instances, which are defined at compile time. Basically it looks like this: [DataContract] class Foo { private static Dictionary<long, Foo> instances = new Dictionary<long, Foo>(); [DataMember] private long id; public static readonly Foo A = Create(1); public static readonly Foo B = Create(2); public static readonly Foo C = Create(3); private static Foo Create(long id) { Foo instance = new Foo(); instance.id = id; instances.Add(instance); return instance; } public static Foo Get(long id) { return instances[id]; } } There are other

Transferring large payloads of data (Serialized Objects) using wsHttp in WCF with message security

自作多情 提交于 2019-11-28 04:34:59
I have a case where I need to transfer large amounts of serialized object graphs (via NetDataContractSerializer ) using WCF using wsHttp. I'm using message security and would like to continue to do so. Using this setup I would like to transfer serialized object graph which can sometimes approach around 300MB or so but when I try to do so I've started seeing a exception of type System.InsufficientMemoryException appear. After a little research it appears that by default in WCF that a result to a service call is contained within a single message by default which contains the serialized data and

C# DataContract Serialization, how to deserialize to already existing instance

北慕城南 提交于 2019-11-27 15:10:20
问题 I have a class, which holds a static dictionary of all existing instances, which are defined at compile time. Basically it looks like this: [DataContract] class Foo { private static Dictionary<long, Foo> instances = new Dictionary<long, Foo>(); [DataMember] private long id; public static readonly Foo A = Create(1); public static readonly Foo B = Create(2); public static readonly Foo C = Create(3); private static Foo Create(long id) { Foo instance = new Foo(); instance.id = id; instances.Add

Transferring large payloads of data (Serialized Objects) using wsHttp in WCF with message security

Deadly 提交于 2019-11-27 00:31:09
问题 I have a case where I need to transfer large amounts of serialized object graphs (via NetDataContractSerializer) using WCF using wsHttp. I'm using message security and would like to continue to do so. Using this setup I would like to transfer serialized object graph which can sometimes approach around 300MB or so but when I try to do so I've started seeing a exception of type System.InsufficientMemoryException appear. After a little research it appears that by default in WCF that a result to