datacontractserializer Questions

5

Solved

I had a quick question regarding the datacontractserializer. Maybe it's more of a stream question. I found a piece of code that writes the xml to a filestream. I basically don't want the file and j...

2

I have the following sample C# code that is auto-genereated from an xsd using the svcutils.exe application. [DataContract] public enum Foo { [EnumMember(Value = "bar")] Bar = 1, [EnumMember...
Twohanded asked 25/1, 2012 at 8:32

4

Solved

Using the DataContractSerializer to serialize my object I get an output similar to <?xml version="1.0" encoding="utf-8" ?> <AgentNotification xmlns:i="http://www.w3.org/2001/XMLSchema-...
Lingonberry asked 23/12, 2009 at 16:55

2

Solved

I have this classes: [DataContract] class ClassA { [DataMember] public Object Value; // and this can be of ClassB or some primitive type. ... } [DataContract] class ClassB : IEnumerable<Key...
Mage asked 13/5, 2015 at 9:12

6

Solved

I'm trying to serialize a class hierarchy to a Json string using DataContractJsonSerializer, in a WCF service. the default behaviour for serializing a derived class is to add the following key valu...
Triumphant asked 13/4, 2011 at 8:30

1

Solved

When de-serializing a flagged enum that is decorated with a EnumMemberAttribute with a value containing a space a SerializationException is thrown. The space in the value is treated as a separator....
Sturgill asked 6/3, 2015 at 12:30

2

Solved

I am using Web API with DataContract serialization. The output looks like this: <Data> <Status> <Date>2014-08-13T00:30:00</Date> <ID>312</ID> <Option>N...
Braw asked 17/8, 2014 at 6:43

3

Solved

How do I serialize a list without the outer element using the Data Contract Serializer? I am using .Net 3.5. I have a class that contains a list, amongst other things, that I wish to serialize with...
Apis asked 21/12, 2011 at 14:5

2

Solved

In VB.NET (using Visual Studio 2008) my WCF service has an interface something like: <ServiceContract()> _ Public Interface IThingService <OperationContract()> _ Function GetThingByN...
Stichometry asked 18/8, 2009 at 14:30

0

With WCF, assume the following service interface: [ServiceContract] public interface IForDataTypeA { [OperationContract] List<DataTypeA> GetValues(); } [DataContract] public class DataTyp...
Bowery asked 11/6, 2014 at 11:34

2

In Assembly A: [DataContract] public class Base { [DataMember] public string SomeText { get; set; } } In Assembly B: internal class Helper { internal static Base Deserialize(string seri...
Conspicuous asked 12/10, 2012 at 12:47

3

Solved

DataContractSerializer does not call a constructor or invoke field initializers when deserializing: DataContractSerializer doesn't call my constructor? Field Initializer in C# Class not Run w...
Mahratta asked 23/2, 2012 at 19:55

2

Solved

I am attempting to save/load a class to an xml file that contains generic types using a DataContractSerializer. I have the save working, but have realized I can't load it because I don't have the l...
Truda asked 27/11, 2013 at 14:34

1

Solved

I have a problem with DataContractSerializer. I use it to create class instances from XML returned by ASP.NET Web Service. But actually the source of data is not important here. To make the whole c...
Altorilievo asked 14/11, 2013 at 22:35

6

Solved

I have a WCF service method that expects an object and then retrieves its properties using reflection. On the client side I create an anonymous type object var obj = new {FirstName="John", Last...
Frijol asked 21/2, 2010 at 19:35

3

Solved

If I have a class defined [DataContract()] class MyObject { [DataMember()] ImmutableList<string> Strings { get; private set} } The ImmutableList<T> type comes from the immutables l...
Dimension asked 23/9, 2013 at 9:5

5

Solved

I am receiving the following error on a WCF call: Maximum number of items that can be serialized or deserialized in an object graph is '65536' I've read a ton of forum posts and many of them ...
Ravelment asked 19/9, 2011 at 20:22

3

Solved

I looked at others posts, but I didn't find solution to my problem. My service config file: <?xml version="1.0" encoding="utf-8"?> <configuration> <configSections> <s...

1

Solved

I'm trying to deserialize an xml document: <?xml version="1.0"?> <games xmlns = "http://serialize"> <game> <name>TEST1</name> <code>TESTGAME1</code> ...

2

The architecture in my application is somewhat like this MainUI------->WCF------->BLL------->DAL I am using Entity Framework 4.0 and .Net Framework 4.0. My data access layer returns Po...

5

Solved

I have a custom Fraction class, which I'm using throughout my whole project. It's simple, it consists of a single constructor, accepts two ints and stores them. I'd like to use the DataContractSeri...
Granados asked 26/10, 2010 at 2:27

1

I want my service to be able to accept and return types derived from BaseType without actually knowing what those types will be. I have almost got a solution using a custom DataContractResolver bas...
Bennet asked 9/4, 2013 at 12:51

2

I'm interested about the best way to go about setting custom element names when using List of primitives with the DataContractSerializer. Let's say I have the following class which contains a List ...

2

Solved

I am using the new .NET 3.0 DataContractSerializer. I have both Nullable<> and List<> objects I am going to serialize. Example: [DataContract(Namespace = "")] class Test { public static voi...
Snapp asked 1/4, 2009 at 23:17

2

Solved

I have a web service that returns the following data: <?xml version=""1.0"" encoding=""UTF-8""?> <RESPONSE> <KEY>12345</KEY> <PROPERTY> <PROPERTY_ADDRESS> &...
Banzai asked 14/3, 2013 at 15:30

© 2022 - 2024 — McMap. All rights reserved.