serialization

How come MooseX::Storage doesn't seem to follow attribute traits for some objects?

Hi, I have put together a little test case to demonstrate my problem: package P1; use Moose; use MooseX::Storage; with Storage; has 'blah' => ( is => 'rw', ); package P2; use Moose; use MooseX::Storage; with Storage; has 'lol' => ( is => 'rw', traits => ['DoNotSerialize'] ); package P3; use Moose; extends 'P2'; has 'ma...

Auto Deserialize XML into a class collection within Silverlight?

Sorry if this is generic in nature, but I have a question that maybe is related to my lack of understanding of some core underlying rules of .NET and Silverlight. I have a basic project at the moment that simply: An ASP.NET generic handler writes out XML Within Silverlight, I am using the WebClient object to get the XML output, in fac...

Locating Serialization Issue in Complex Bean

I have a large bean graph that I'm trying to serialize. Getting serialization exception (a non-specific one). Anyone have a class that will help locate the issue? ...

Byte for byte serialization of a struct in C#

I'm looking for language support of serialization in C#. I could derive from ISerializable and implement the serialization by coying member values in a byte buffer. However, I would prefer a more automatic way like one could do in C/C++. Consider the following code : using System; using System.Text; using System.Runtime.Serialization; ...

What is serialization?

Hi I am getting started with OOP programming and would like to know what is the meaning of serialization in OOP parlance? I am not a native english speaker hence the question. ...

Save snapshot data to XML

I have 5 tables belonging to 2 different datasets, I use them to populate some grids in a page. I want to implement some snapshot functionality and I need to save the data in the tables in an XML in the database. I was thinking of simply serializing the tables to XML using the .Net XmlSerializer (deserializing also), but there is a lot o...

WCF: Is there a way to remove ExtensionData field?

I just started using WCF and I already came to a project-altering issue. I created a service and put in reference in a webservice, but the every field in the webservice xml file comes with an ExtensionData field. Example: I don't want this. I need it to be only: Is there a way to remove this field? Some different kind of serializa...

How can I manually create WCF OperationContract body type?

I'm trying to code a web service client in Silverlight for a RESTful WCF service that I have developed. In Silverlight I am constructing the body of the WebRequest using a DataContractSerializer instance. This approach works great if there is a single argument for the OperationContract. It doesn't work so well if there are multiple ar...

.NET How to serialize a TimeSpan to XML

I am trying to serialize a .NET TimeSpan object to XML and it is not working. A quick google has suggested that while TimeSpan is serializable, the XmlCustomFormatter does not provide methods to convert TimeSpan objects to and from XML. One suggested approach was to ignore the TimeSpan for serialization, and instead serialize the result...

How to serialize collections in .net

I want to serialize a collection of objects for storage/retrieval from my app.config file. (I'm using the code from an example from Jeff Attwood's blog entry The Last Configuration Section Handler.. Revisited). What I want to know, is why collections of objects of type public class MyClass { ... } get serialized to an xml element ...

Python: Incrementally marshal / pickle an object?

I have a large object I'd like to serialize to disk. I'm finding marshal works quite well and is nice and fast. Right now I'm creating my large object then calling marshal.dump . I'd like to avoid holding the large object in memory if possible - I'd like to dump it incrementally as I build it. Is that possible? The object is fairly si...

C#: Mixing custom and basic serialization?

Hi, I've got a class with well over 100 properties (it's a database mapping class) and one of the properties has to be in a method. In other words this data is not exposed via a property but via methods: "ABCType GetABC(), SetABC(ABCType value)" It's all very un-C#-like. I shudder when I see it. The class needs to be serializable so ...

When implementing IXmlSerializable, how to only override either ReadXml or WriteXml and not both?

I would like to implement IXmlSerializable on a class and only override either ReadXml or WriteXml, but not both. If I didn't implement IXMLSerializable on this class, the XMLSerializer would automatically serialize all members. I'd like that default behavior to apply for the non-overridden case. However, since IXmlSerializable is an ...

NetDataContractSerializer equivalent for Silverlight?

Has anyone developed or know of a place where I could find a Silverlight implementation of NetDataContractSerializer? This WCF and Silverlight Comparison states that Silverlight does not ship with an implementation of NetDataContractSerializer. I'm hoping to avoid developing one myself. Thanks! ...

High performance serialization: Java vs Google Protocol Buffers vs ... ?

For some caching I'm thinking of doing for an upcoming project, I've been thinking about Java serialization. Namely, should it be used? Now I've previously written custom serialization and deserialization (Externalizable) for various reasons in years past. These days interoperability has become even more of an issue and I can foresee ...

How to customize WCF XML serialization

We have an existing SOAP web service interface that we want to implement using WCF for a new application. This seems to work fine except for one small detail. The XML namespace of the return type of a function must be different than the XML namespace of the web service itself. And for the life of me, I can't get it to work. I've recreat...

Structs to Byte Arrays to send over sockets

What is the best way to get a byte array from a struct to send over TCP sockets? I'm using .Net (VB or C#). ...

Javascript / PHP cookie serialization methods?

I have a form which I would like to store the values of in a cookie so the user doesn't have to re-enter the form every visit. (The form is a few selects to filter search results.) I would like for the cookie serialization to easily be readable from javascript (obviously to set the form onLoad), but I'd also like to be able to read the ...

How to deserialize an Xml Fragment using the XML Reader

I am trying to deserialize a Xml Fragment. I am nearly there but it throws an error where by it does not expect the first element. An example of the XML in the stream is as follows: <Project xmlns="http://schemas.datacontract.org/2004/07/Swissmod.Service.Model" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"&gt; <ClientID>1</C...

Serialize and send a data structure using Boost?

I have a data structure that looks like this: typedef struct { unsigned short m_short1; unsigned short m_short2; unsigned char m_character; } MyDataType; I want to use boost::serialization to serialize this data structure, then use boost::asio to transmit it via TCP/IP, then have another application receive the data and de-seri...