serialization

iPhone Serialization problem

Hi, I need to save my own created class to file, I found on the internet, that good approach is to use NSKeyedArchiver and NSKeyedUnarchiver My class definition looks like this: @interface Game : NSObject <NSCoding> { NSMutableString *strCompleteWord; NSMutableString *strWordToGuess; NSMutableArray *arGuessedLetters; /...

Does the XmlSerializer escape special chars like & ?

I'm trying to refactor a library that's transmits it's object as XML. Although I think the XmlSerialzer of the .NET Framework can handle the serialization, the class all have a ToXML function. In it all string values are being put through a function that escapes characters like & and alike. Does the XmlSerializer not escape those kind...

Storing Interface type in ASP.NET Profile

In my ASP.NET website all calls into the data layer return entities as interfaces and the website does not need to know what the concrete type is. This works fine, but I have run into a problem when trying to store one of those types into the user Profile. My interface implements ISerializable, like the following: public interface IInsu...

Serializing a object with an image to be saved to SQL database

I have the following object: [Serializable] public class ExampleImage { public int ID { get; set; } public string Filename { get; set; } public byte[] Content { get; set; } } I store this in a List<ExampleImage> which I then pass to the following function to serialize it to a string: static string SerializeObjectToXmlStri...

c# serialized JSON date to ruby

Hi guys, I have a C# application that serializes its DTOs to JSON and sends them accros the wire to be processed by Ruby. Now the format of the serialized date is like so: /Date(1250170550493+0100)/ When this hits the Ruby app I need to cast this string representation back to a date/datetime/time (whatever it is in Ruby). Any ideas h...

Deserialization not working in WCF

I have a simple class, let's say "Team" and I expose a WCF service (basicHttpBinding, hosted in IIS) with a GetTeams operation which returns an array of Team. The Team class looks like [DataContract] public class Team { [DataMember] public int Id { get; set; } [DataMember] public Point Position { get; set; } [DataMe...

How to choose inner xml tag when serializing a list<string> ?

Hi, I think I already did that once upon a time, but I can't get it to work... I've got a class that contains a variable List<string> InputList; When serialized, it's obviously like: <InputList> <string>foo</string> <string>bar</string> </InputList> And, call me a control freak, but I want: <InputList> <Input>foo</In...

SerializationException on 'CustomIdentity' when user is denied in ASP.NET

...

Problems serializing DBML objects C#

I am trying to serialize some Linq objects using this code. private byte[] GetSerializedObj(object o) { try { DataContractSerializer formatter = new DataContractSerializer(o.GetType()); MemoryStream memStream = new MemoryStream(); formatter.WriteObject(memStream, o); return memStream.ToArray(); ...

XML to JavaScript hashes/arrays on the client

Any client js libraries for turning XML into a JavaScript object? I'm specifically working with RSS and ATOM XML. I don't want to go from XML to JSON then eval(). I'd like to go from XML directly to JavaScript hashes/arrays. ...

Serialize WCF message in a binary way, and not as a SOAP Message

I have a client-server application, which communicates using WCF, and uses NetDataContractSerializer to serialize the objects graph. Since a lot of data is transferred between the server and the client, I tried to decrease its size by fine tuning the size of the data members (e.g. changed int to short, long to int, etc.). After finis...

DataContractSerializer not Serializing member of class that inherits ISerializable

I have this class: using System; using System.Collections.Generic; using System.Runtime.Serialization; namespace Grouping { [Serializable] public class Group<T> : HashSet<T> { public Group(string name) { this.name = name; } protected Group(){} protected Group(Serializati...

Serialize unique form from page of many for AJAX. Works in FF/Safari, but IE serializes ALL forms on page

I have a page of similar items, each in their own form I want to update using Ajax. For each item, I append a counter onto the end of the form id, so each form has a unique id. I also store this "counter id" as an attribute in the submit element, so I can dynamically build the form name in JQuery. It works perfectly in FF win/mac and Sa...

XslCompiledTransform and Serialization

Hello, I am trying to implement some functions that will convert one object to another with XslCompiledTransform. I found some implementations for Serializing an object to XML string and DeSerialize the XML string to an object. Another function does the XslCompiledTransform from object1 to obejbct2. To generate the XSLT file i used t...

What would be the correct way to serialize this Java Object in Clojure?

I have a dummy Java Program, which I want to write in Clojure. It has a class which implements Serializable and a function which saves it. Since I have never written such programs in Clojure, I wanted to know what would be the correct way to approach this problem, what Clojure data structures, and api calls would you use? import java. i...

Silverlight 3.0 Binary Serialization Support?

Can I deserialize an object in the Silverlight 3.0 runtime that was serialized using the full .NET 2.0 runtime using the BinaryFormatter? I am using the following code to serialize an object to a ByteArray which we write to a DB table: MemoryStream serStream = new MemoryStream(); BinaryFormatter binFormatter = new Binar...

Serialize MS Access Database Objects to Text File(s)

Is there some code out there that lets me serialize all the objects in an MS Access MDB File. All the Objects like Table definitions, Table Data, Query defintions, Report definitions, VB Modules should be written to one or multiple text files. It is not necessary to reverse the operation (but would be nice to have). I want to put the t...

What is the correct way to serialize nullable types?

I'm implementing IXMLSerializable in one of my classes. It contains a few numeric properties that are nullable (int? double? etc..) What is the correct way to serialize/serialize these through IXMLSerializable? Here's what I'm doing now, which works, but obviously does not seem like the correct way to do it. void IXmlSerializable.Write...

strange out-of-memory exception during serialization

Hello everyone, I am using VSTS2008 + C# + .Net 3.5 to run this console application on x64 Server 2003 Enterprise with 12G physical memory. Here is my code, and I find when executing statement bformatter.Serialize(stream, table), there is out of memory exception. I monitored memory usage through Perormance Tab of Task Manager and I fin...

Can we deny a java object from serialization other than giving transient keyword

We can avoid serialising fields by using the transient keyword. Is there any other way of doing that? ...