Questions tagged [datacontractserializer]

.NET Framework class, Serializing and deserializing an instance of a type into an XML stream or document using a supplied data contract.

900 questions
0
votes
1 answer

WCF datacontractserializer Deserialize direction

I am having trouble understanding how to use the DataContractSerializer in WCF REST I am using a channel factory like so: Uri uri = new Uri("http://localhost:50000/people"); WebChannelFactory chFactory = new…
user975044
  • 375
  • 4
  • 11
  • 26
0
votes
1 answer

Unknown identifier "DataContractSerializer"

I am in total confusion. I am learning to use DataContractSerializer class by following the example and my compiler keeps saying that it doesn't exist. Isn't DataContractSerializer in System.Runtime.Serialization namespace? Or do you also have to…
ThN
  • 3,235
  • 3
  • 57
  • 115
0
votes
1 answer

How to format serialization of IDictionary with DataContractSerializer?

I am using the following code to Serialize / Deserialize from object to XML using System.Runtime.Serialization; public static string Serialize(this T obj) { var serializer = new DataContractSerializer(obj.GetType()); …
Kenci
  • 4,794
  • 15
  • 64
  • 108
0
votes
1 answer

xslt grouping - convert from one xml format to other

I have an xslt written for transforming from one xml format to the other. my source file has multiple "production orders" and one "Sales Order" my destination has only one "sales Order" which holds all production orders. Here is my source xml…
KRP
  • 131
  • 1
  • 3
  • 15
0
votes
1 answer

Why does the DataContractSerializer not work?

I don't know how to Serialize a object by DataContractSerialize. Here is my code: public static string DataContractSerialize(object target) { var formatter = new DataContractSerializer(target.GetType()); using (var stream =…
GeminiYellow
  • 1,016
  • 2
  • 12
  • 34
0
votes
2 answers

Skip DataMember via DataContractSerializer

I have a class: [DataContract] public class Result { [DataMember] public String Log {get; set;} [DataMember] public String Data {get; set;} } I send this class via WCF and it works fine. But I want to save this class to a xml file after…
xtmq
  • 3,380
  • 22
  • 26
0
votes
1 answer

WCF service support both data contract serializer and xml serializer

I would like to create a WCF Service that would return both Json and XML based on the "Accept" header in the request. I would like to use the XML serializer because I have more control over the xml output. For returning json I need to use the…
Mark
  • 53
  • 1
  • 3
-1
votes
1 answer

DataContractSerializer Best Practices?

Edit -- I'll try to make my question more to the point I am working with the DataContractSerializer. I noticed that when I instance the serializer, I can specify the Namespace and the Name. Is there any guidance out there (or maybe a…
JMarsch
  • 21,484
  • 15
  • 77
  • 125
-1
votes
2 answers

Newtonsoft Json - Serialize Deep nested object based on given selected properties

Does Newtonsoft Json have any way to serialize nested objects with only selected properties ? The model looks like: class Node { int id{ get; set; }; string name{ get; set; }; IListchildren{ get; set; }; } I am creating a tree structure…
netcoredev
  • 35
  • 2
  • 7
-1
votes
2 answers

DataContractSerializer documentation

I'm looking for a good in depth documentation/how-to for DataContractSerializer. Google turns up a number of related articles but nothing jumped out at me. (I'm not looking for the MSDN link) A little clarification: I have never use serialization in…
BCS
  • 75,627
  • 68
  • 187
  • 294
-1
votes
1 answer

DataContractJsonSerializer - deserializing to non-attributed/inherited class

I would like to use the c# DataContractJsonSerializer to de-serialize some json into a type that lacks serialization attributes. This type also inherits from multiple interfaces with each interface having many public properties. I cannot alter the…
-1
votes
1 answer

Get List of only one length when I split String with character array

I use this property to help users filter results, by specifying what shouldn't appear. They can separate their terms with all the characters in INCLUDE_INTERPRET_SEPARATORS. The String is saved to an XML file at startup and close. However, the List…
Expotr
  • 49
  • 6
-1
votes
1 answer

Apply IOperationBehavior override for plain serialization? (not service)

I would like to create an [CustomDataMember] attribute that override the formatter behavior of DataContractSerializer through an IOperationBehavior. I have followed the instructions given by Aaron Skonnard but when I call the DCS serializer, the…
Joannes Vermorel
  • 8,976
  • 12
  • 64
  • 104
-1
votes
1 answer

How to Parse Json webService response in WP7

I want to display data in Listbox without using any DLL.And my webservice responding in json format. My Web service Response is as below.it has more than 800 records [ { "st_id":"1", "st_name":"name xyz" }, { "st_id":"2", …
user1140237
  • 5,015
  • 1
  • 28
  • 56
-2
votes
2 answers

Type 'System.Windows.Input.Cursor' cannot be serialized

i want to serialize the datacontract this is code datacontract [Serializable] //[DataContract(Name = "Shared", Namespace =…
Puja Surya
  • 1,155
  • 4
  • 20
  • 47
1 2 3
59
60