serialization

Is it possible to deserialize JSON to List<MyObject<T,K>> with JSON.Net

I have a class: [Serializable] public class KVPair<TKey, TValue> { public TKey Key { get; set; } public TValue Value { get; set; } public KVPair(TKey k, TValue v) { Key = k; Value = v; } } that I create: List<KVPair<string,string>> kvPairs; Using the J...

C# Version class serializable?

I've got a class with a version (which actually contains the Version class) property. Like I said, version contains an instance of Version, which looks like this: Version Build: 111 Major: 1 MajorRevision: 0 Minor: 1 MinorRevision: 10 Revision: 10 When I serialize the class, version is always empty: <Version /> The Client-class...

Translate Service Call Object Back to the Original Object

I have an object exposed through a web service that is consumed by another system. That system also uses that same WSDL to return back an object on demand to us. I was wondering if it was possible to take that same object and relay it back to a the original object? I tried to do the following and it wouldn't actually cast it back with t...

XmlSerializer.Deserialize on a List<> item

Hi all I've tried all the solutions I could find on SO and elsewhere, but can't seem to figure out why this is not working. Straightforward deserialization of an XML string into an object, the object has one property - a List: [XmlTypeAttribute(AnonymousType = true)] public class UpdateData { [XmlArrayItem(ElementName = "Updates...

Creating Java object with boost::posix_time::ptime serialized XML representation

Hello, I have following XML generated by serializing a boost::posix_time::ptime structure. I want to create a Java Date object with this XML. <timeStamp class_id="0" tracking_level="0" version="0"> <ptime_date class_id="1" tracking_level="0" version="0"> <date>20100119</date> </ptime_date> <ptime_time_duration class...

serialization of function/api calls (at a target) over some transport

I have set of api's to be called over a transport (say for eg RS232 and some other transports). Essentially the calling side runs on a host and sends something like this: (func_name, param_1, param_2, param_3) over the RS232 link and a bit of code at the other end does the actual function calling. To transfer the function name and par...

Serialization in java

When i define a java object to implement serializable interface, do the members of the object, also become serializable? Or i have to go as far along the nesting depth, to redefine every object along the path as serializable? ...

How can I append to an existing java.io.ObjectStream?

As for now I will get java.io.StreamCorruptedException when I try to append an Object. I have searched the Internet for a way to overcome that. The answer I found so far is it can't be done. A way around this problem is to write the objects into a list and then write the list to the file. But I have to overwrite that file everytime when...

Django : json serialize a queryset which uses defer() or only()

Now I've been using json serializer and it works great. I had to modify my queries where I started using the only() & defer() filters, like so - retObj = OBJModel.objects.defer("create_dt").filter(loged_in_dt__gte=dtStart) After I've done the above, suddenly the json serializer is returning empty fields - {"pk": 19047, "model": "OBJ...

Rehosting the WF4 designer - how to save and execute workflows created through the rehosted designer.

I'm looking for some clarity with regards to the use of Windows Workflow 4 in an integrated solution - specifically with regards to rehosting the designer and executing workflows created by eg. a business user. Is the intention that the required custom activities are created and compiled into a dll, which is then deployed with the reho...

why not a lua implementation of google's protocol buffers? is there already any better solution exist for lua?

why not a lua implementation of google's protocol buffers? is there already any better solution exist for lua? ...

Creating a service-only subclass of a WCF DataContract class

Is the following concept possible, or will I have trouble serializing this to the Client. Assuming that all comms are only dealing with BaseContractClasses but the Server uses the special sub-class to collate extra server-only data. [DataContract] public class BaseContractClass { [DataMember] public int valueToTransmit; } public cl...

How to I serialize a large graph of .NET object into a SQL Server BLOB without creating a large buffer?

We have code like: ms = New IO.MemoryStream bin = New System.Runtime.Serialization.Formatters.Binary.BinaryFormatter bin.Serialize(ms, largeGraphOfObjects) dataToSaveToDatabase = ms.ToArray() // put dataToSaveToDatabase in a Sql server BLOB But the memory steam allocates a large buffer from the large memory heap that is giving us prob...

How to serialize object to text WITH type info?

I want to serialize objects to text, but I want to preserve the type info so that I may deserialize without a reference to the type object. XML Serialization gives me the text I want, but does not keep the type info. What I've read about binary serialization is that it keeps the type info, but its not readable. Looks like the SoapForm...

boost serialization issue with shared_ptr to std containers

Hi I am using boost/1.41.0, and the following code give me compilation error when I try to deserialize a shared_ptr. The serialize part it compiled successfully. Can someone advise me if this is a bug in my code or a general issue for boost? Thanks. Yanchao #include <iomanip> #include <iostream> #include <cstddef> // NULL #include <fst...

C# serialization dropping property in subclass?

When I try to serialize a populated instance of type List<C>() where: public class A<T> : List<T> { [XmlAttribute("Name")] public string Name {get; set;} public A() {} } public class B { [XmlAttribute("Other")] public string OtherPCO { get; set:} } public class C : A<B> { } The serialization drops the Name pr...

GWT java.util.Date serialization bug

GWT doesn't serialize Java Date properly. When I tried sending Date created in Javascript through the wire, I found out that dates between April 1st (funny) and 25th October for years before year 1983 get subtracted by one day. That means that, say, both 1982-04-01 and 1982-03-31 become 1982-03-31 on the Java side. Given the dates in q...

Cross-window Javascript: is there a right way?

Problem I'm trying to make a method that passes objects to a similar method in a popup window. I don't have control over the code in the target method, or the object passed in. The target method currently serialises the object, using JSON.stringify where possible, or instanceof Array. The first problem with this is a bug in IE8 (see ...

MySQL Update Serialized Data

How to update serialized data in DB Table field? I want to store serialized data to reduce count of queries but don't have idea how to update them. ...

Does a variable in occupy the same space in memory as when serialized?

if the class was had a SerializableAttribute and its object was serialized with BinaryFormatter, the serialized size is equal to the size it occupied in memory? Edit: Additional question: is there a better way to find how much space an object occupies in the memory? is this method approximate enough? ...