serialization

Should I use Storable or FreezeThaw to serialize Perl data as a cookie value?

I'd like to store some data in a cookie and my initial though was to pack it myself, but then I remembered that There Is A Module for Everything. I have looked at both Storable and FreezeThaw. Both seem appropriate, though the latter mentions string specifically and seems to serialize into a string without newlines, whereas Storable cr...

How to store information in an XML file with serialized values

HI, I would like to have the configuration data for my application stored in a XML config file that I modify manually, however, I'm not sure how I would go about storing more complex types. For example, If I wanted to store X,Y coordinates and I had a class to represent this, its easy enough to specify the data type, but I have no ide...

Can JavaScriptSerializer exclude properties with null/default values?

I'm using JavaScriptSerializer to serialize some entity objects. The problem is, many of the public properties contain null or default values. Is there any way to make JavaScriptSerializer exclude properties with null or default values? I would like the resulting JSON to be less verbose. ...

How to Serialize a list in java?

I would like to deep clone a List. for that we are having a method SerializationUtils.clone ( object ) // apache commons method. Object shld be serializable so now to clone my List i should convert that to serializable first. Is it possible to convert a List into Serializable list? ...

XML serialisation won't write out lazy-evaluated property

Following on from a previous question, I am having trouble combining the Lazy<T> generic that was suggested with my XML Serialization. Here is the functionality I am using for Lazy<T>: public struct Lazy<T> where T : class, new() { private T _Value; public bool HasValue { get { return (_Value !=...

Force XML elements to match the class order when serializing.

Is there a way to force XML elements generated from XML serialisation to be ordered in the same way as defined in the object class? i.e. class SerializableClass { [XmlElement("Element.1")] public List<string> Element1 { get { return _Element1; } set { _Element1 = value; } } private List<string> _...

WCF and eBay SDK library

Hi everybody, I've a question about WCF. I created a WCF service with a MSMQ endpoint. This service is exposed by a Windows Service and the service is consumed by an Asp.net application. My Asp.net application uses an external DLL containing classes and enums (defined by eBay) that I'd like to use in my DataContract. I cannot modify th...

.Net 1.0: Is there a Serializable attribute for the Compact Framework

Going "old school" with a .Net 1.1 Compact Framework app and I'd like to be able to serialize a list of objects to memory -- are there any serialization libraries included in the 1.0 framework? I should add that the System.Runtime.Serialization namespace doesn't exist in the 1.1 Framework (or so my compiler says). ...

Convert a JSON string to object in Java?

Is there a way in Java/J2ME to convert a string, such as: {name:"MyNode", width:200, height:100} to an internal Object representation of the same, in one line of code? Because the current method is too tedious: Object n = create("new"); setString(p, "name", "MyNode"); setInteger(p, "width", 200); setInteger(p, "height", 100); May...

Convert a JSON string to object in J2ME?

I've asked this before for Java, but this applies specifically to J2ME. Is there a way in J2ME to convert a string, such as: {"name":"MyNode", "width":200, "height":100} to an internal Object representation of the same, in one line of code? The problem with such JSON libraries, is that they generate JSONObjects from strings, not...

.net xml serializer not encoding some characters

I a class containing multiple properties of type string. One of the values contains a character of hex value 96. If I serialize the class to xml, the xml serializer does not encode that character, and if I view the xml in various tools such as IE or SQLServer with OpenXML, it complains that the character is invalid in an xml document. ...

Need Help on Looping Through Deserialized Custom Class

I am having a hard time figuring out how to expose (& loop through) the properties of my Categories class which was serialized (using JSON) in a WCF service and deserialized on the server as illustrated below. JavaScriptSerializer serializer = new JavaScriptSerializer(); Category cat = serializer.Deserialize<Category>(param1); // M...

Serialize JavaScript data structures for SQLite

My goal is to serialize JavaScript native datatypes for storage into an SQLite database. I'm doing this within a Firefox extension, and so I have access to the Mozilla platform XPCOM api. Initially I was thinking that the easiest thing to do would be to just store JSON strings. However, if there is a way to serialize native datatypes w...

Serializing fields in a custom DataSet to XML

Is there any way to add fields to a DataSet which will be serialized along with the table information when the DataSet is serialized in XML? I have some information that describes the DataSet that I want to try to include inside it when I throw it around in XML. I've tried adding fields and classes in the partial class Visual Studio gene...

How can produce a DOCTYPE declaration with DOM level 3 serialization API?

I have a DOM Document created from scratch and I need to serialize it to an output stream. I am using DOM level 3 serialization API, like in the following example: OutputStream out; Document doc; DOMImplementationLS domImplementation = (DOMImplementationLS) DocumentBuilderFactory.newInstance().newDocumentBuilder().getDOMImplement...

Serialization problem

We save and read files by (de) serializing a class named "DocumentClass". All was working well, untill we added 2 more fields to the documentclass. (We think that's the problem) When we now try to open files that were serialized by the previous edition, we get an error. System.ArgumentException: Object of type 'System.Int32' cannot be ...

Ignoring a field during .NET JSON serialization; similar to [XmlIgnore]?

I have a POCO class that is being sent to the browser as a JSON string in .NET 3.5 sp1. I am just using the default JSON serialization and I have some fields that I want to ignore. I want to put an attribute similar to [System.Xml.Serialization.XmlIgnore] on them so that they are not serialized. ...

Java: ObjectOutputStream with Serializable problem

Hello, I have these three classes: Command: package pack; public abstract class Command impements java.io.Serializable { public abstract void execute(); } Client: package pack; // imports.... public class Client { Socket socket; // Constructor... public void sendCommand(Command c) { try { ...

SerializationException with custom GenericIdentiy?

I'm trying to implement my own GenericIdentity implementation but keep receiving the following error when it attempts to load the views (I'm using asp.net MVC): System.Runtime.Serialization.SerializationException was unhandled by user code Message="Type is not resolved for member 'OpenIDExtendedIdentity,Training.Web, Version=1.0.0....

If I change the base class that a Java Exception class extends, do I need to update the serialVersionUID value?

Consider the following Java exception classes: public class FooException extends RuntimeException { // [...] } public class FooException extends BarException { private static final long serialVersionUID = -5322002268075295537L; // [...] } If I wish to update the inheritance hierarchy to remove BarException, such that Foo...