serialization

C# JSON to LIST extension method

From Scottgu's post i got the code to Serialize a collection to JSON object.(i)How to convert the JSON object back to List? (ii) I did not find JavaScriptserializer in System.Runtime.Serialization will the only code work for VS 2010? ScottGu's snippet namespace ScottGuHelper.JSON { public static class JSONHelper { public sta...

DataContract XSD issue

I am wanting to validate a DataContract (long story short) Here is my DataContract: [DataContract(Name = User.Root, Namespace = "http://mysoft.com/schemas/registeruser.xsd")] public class RegisterUser { [DataMember(Name = User.EmailAddress)] public string EmailAddress { get; set; } [DataMember(Name = User.UserName)]...

ASP.NET to WCF serialization issue(?)

so, I've got something like this: there's an ASP.NET application (1) that references WCF service (2) that references .NET application (3). (1) creates query gives it to (2), (2) gets some info from (3), processes it and returns it back to the (1). And here's the issue - there's DataContract class for request (that is used by both (2) an...

WCF MessageContract List Serialization

I have the following MessageContracts to use as a request: <MessageContract(WrapperName:="get")> _ Public Class GetRequest Inherits BaseAuthenticatedRequest Protected _typeName As cEnum.eType Protected _id As Integer <MessageBodyMember()> _ Public Property TypeName() As cEnum.eType ... <MessageBodyMember()...

Serializing Entity Framework problems

Like several other people, I'm having problems serializing Entity Framework objects, so that I can send the data over AJAX in a JSON format. I've got the following server-side method, which I'm attempting to call using AJAX through jQuery [WebMethod] public static IEnumerable<Message> GetAllMessages(int officerId) { SIBSv2Enti...

What changes can make serialized class versions incompatible?

I'm experimenting with the java serialization API to create small persistent objects. In my research I have found a lot on the importance of versioning, so you can detect and handle incompatible changes between the stored object model and the current object model. What I can't seem to find is what changes to the object model can actual...

WCF SOAP service changing name of array item elements when (de)serializing.

I have a client (that isn't very flexible in the SOAP it sends) which generates SOAP similar to the following from a method with signature void Test(int[] test): <?xml version="1.0" encoding="UTF-8" ?> <SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="h...

Serializing Interface objects to JSON

I have a number of interfaces I use to pass business objects around in my application. Using Ninject, I can do whatever I want with them without needing to know the type of the actual object; in this case, most of them are actually various Linq to Sql objects that implement the interface. For example, I have a Linq to Sql object called ...

sending/receiving objects through tcpclient

Hello! i have to send/recieve objects(of a custom class made by me) in my c# .net 4.0 app and i would like a good tutorial to get me started because i've searched on google and there seem to be a lot of problems with serialization/ deserialization and although the problems we're solved, there are a lot of ugly hacks . Regards, Alexa...

Serializing DataAnnotations

I would like to store DataAnnotations inside a database. How can I retrieve a string representation of a DataAnnotation by reflection (or by other means)? Example public class Product { [DisplayName("Price")] [Required] [RegularExpression(@"^\$?\d+(\.(\d{2}))?$")] public decimal UnitPrice { get; set;...