serialization

SerialVersionUID with "private static final long" still gets InvalidClassException

I have compiled and jarred the various projects in my Java application, generating serialVersionUIDs automatically through Eclipse for all my classes derived from Serializable. I read the answers to this question, and verified that serialVersionUids are all private static final long. Nevertheless, I get an error like this when I try t...

Kryo serialization library: is it used in production?

Kryo is a very new and interesting Java serialization library, and one of the fastest in the thrift-protobuf benchmark. If you've used Kryo, has it already reached enough maturity to try it out in production code? Update (10/27/2010): We're using Kryo, though not yet in production. See my answer below for details. ...

Subsonic 3 : get only certain columns

Hello, I use : Subsonic 3, SQL Server 2008, Json.Net Here is my problem : I have a house table with id,lot number, address, location, ownerid and an owner table with id,name, description. I'd like to get only the owner name and address of house where location is "San Francisco". How can I do this with Subsonic? My problem is I can ...

Serialize Objects using xmlSerializer.Serialize and IEnumerable objects

I have an object that holds an object that is definded as IEnumerable, i.e. [Serializable] [XmlRoot("MyObject")] public class MyObject { [XmlAttribute] public string Name { get; set; } [XmlArrayAttribute("Numbers")] public IEnumerable<string> Numbers { get; set; } } When I run the XmlSerializer.Serialize against the o...

Serializing struct containing char*

I'm getting an error with serializing a char* string error C2228: left of '.serialize' must have class/struct/union I could use a std::string and then get a const char* from it. but I require the char* string. ...

...may not be used in this context...while serialization

Hi, I've webservice and WebMethod [webMethod] [XMLInclude(typeof(ContractCar[])) public object GetObjects(Cars[] cars) { return Translator.ToObjects(Facade.GetObjects(cars); } public static object GetObjects(Cars cars) { List<Car> cars =new List<Country(...fillingcollection) return cars.ToArray(), } public static object ToObjects(o...

Passing a web service an unknown number of parameters

I'm relatively new to utilizing web services. I'm trying to create one that will be accepting data from a ASP.Net form whose input controls are created dynamically at runtime and I don't how many control values will be getting passed. I'm thinking I'll be using jQuery's serialize() on the form to get the data, but what do I have the ...

How to decode base64-encoded <data> (CFData/NSData) property in a property list?

I am trying to reverse-engineer a preferences file (not for any nefarious purposes, just so that I can script usage of it) that, among other things, has arrays of coordinates stored within it. This is the salient snippet from the property list: <dict> <key>$class</key> <dict> <key>CF$UID</key> <integer>34</integer> </dict...

Sending a Tuple object over WCF?

Is the System.Tuple class supported by WCF's Data Contract Serializer (i.e., can I pass Tuple objects to WCF calls and/or receive them as part or all of the result)? I found this page, but not the clear, definitive "you can send and receive Tuples with WCF" answer I was hoping for. I'm guessing that you can, as long as all of the type...

serializing type definitions?

I'm not positive I'm going about this the right way. I've got a suite of applications that have varying types of output (custom defined types). For example, I might have a type called Widget: Class Widget Public name as String End Class Throughout the course of operation, when a user experiences a certain condition, the applic...

How do I update with a newly-created detached entity using NHibernate?

Explanation: Let's say I have an object graph that's nested several levels deep and each entity has a bi-directional relationship with each other. A -> B -> C -> D -> E Or in other words, A has a collection of B and B has a reference back to A, and B has a collection of C and C has a reference back to B, etc... Now let's say I want ...

How does versioning work when using Boost Serialization for Derived Classes?

When a Client serializes the following data: InternationalStudent student; student.id("Client ID"); student.firstName("Client First Name"); student.country("Client Country"); the Server receives the following: ID = "Client ID" Country = "Client First Name" instead of the following: ID = "Client ID" Country = "Client Country" The...

String to Date/Time

I have a serialized DateTime string which looks like this: 2010-04-14T16:32:06.75+10:00 What is the simplest way of deserializing/parsing it back into a DateTime? Edit: Sorry. I was a bit too quick and forgot to add... I'm using C# .Net ...

Why is a .net generic dictionary so big

I am serializing a generic dictionary in VB.net and I am very surprised that it is about 1.3kb with a single item. Am I doing something wrong, or is there something else I should be doing? I have a large number of dictionaries and it is killing me to send them all across the wire. The code I use for serialization is Dim diction...

Serializing and deserializing a map with key as string

Hi! I am intending to serialize and deserialize a hashmap whose key is a string. From Josh Bloch's Effective Java, I understand the following. P.222 "For example, consider the case of a harsh table. The physical representation is a sequence of hash buckets containing key-value entries. Which bucket an entry is placed in is a functio...

Problem with object serialization in Applet-Servlet communication

Hi guys, I spent a lot of time on thinking what is wrong with the following code. I send the object from my applet to servlet and then I read the object from servlet. Everything goes fine till reading serialized object from the servlet - I got IOException. Thank you in advance! Here is the code: Applet: try { URL servletURL =...

Convert a byte array to a class containing a byte array in C#

I've got a C# function that converts a byte array to a class, given it's type: IntPtr buffer = Marshal.AllocHGlobal(rawsize); Marshal.Copy(data, 0, buffer, rawsize); object result = Marshal.PtrToStructure(buffer, type); Marshal.FreeHGlobal(buffer); I use sequential structs: [StructLayout(LayoutKind.Sequential)] public new class Packe...

Rtti for Variant Records

I try to write a kind of object/record serializer with Delphi 2010 and wonder if there is a way to detect, if a record is a variant record. E.g. the TRect record as defined in Types.pas: TRect = record case Integer of 0: (Left, Top, Right, Bottom: Longint); 1: (TopLeft, BottomRight: TPoint); end; As my serializer should work recu...

EclipseLink: onetomany relationships with lazy loading loaded with serialization

Hello, I'm facing a problem with eclipselink under websphere 7.0 in a clustered environment. When my entity is serialized every 1-n relationship lazy is loaded, even if the entity is detached. How can I avoid this behavior, without having to use DTO? Thank you very much ...

Debug Deserialization on Silverlight Client

I'm working on a Silverlight client that interacts with a WCF web service. The Silverlight client and the WCF web service are using the same class library for their data entities that they are passing back and forth over the wire. I just added a new entity, and it's not being correctly deserialized on the Silverlight client. My questio...