serialization

most efficient winsock design for high load network application

Hello, I know it is a general question but I need your recommodations about a TCP server/client application. The server is only supposed to handle one connection at a time. Server is sending live images (one frame is approx. 50K and 20 frames per second) to connected client. Actually at the startup of the server and client applicatio...

what could modify the SerialVersionUID while serializing and storing in a Jarfile ?

Hello, I am facing some issues while serializing objects (I am using JBoss Drools, and want to store an ArrayList of KnowledgePackage). When I serialize the list, store the result in a file, and deserialize it, no problem occurs, so it works fine. But when I serialize the list, store the result in a byte stream, then save it in a JarF...

How can I serialize a jpa bean that will also get the lazy loading relationship?

I need to serialize the result of a jpql query (meaning I need to serialize all the jpa beans). I want to get all nested relationship (even if they are lazy loaded) so that the client can deserialize on the other end without getting error. Is there a way to do that? ...

xsd.exe/XMLSerializer equivialent for Java ?

Is there something akin to the .NET xsd.exe for java - generating classes from a schema that you can easily de-serialize ? - or , What's the common practice for parsing and pull out/validate the content xml documents in Java ? Traversing a DOM tree and littering code with XPath queries to get the data you need seems quiet messy. ...

Custom .NET Serialization doesn't seem to work

I am using BinaryFormatter to serialize a collection of objects of class A stored in a System::Collections::Generic::List<A^>^. I have added the [Serializable] tag and have implemented ISerializable in class A (both GetObjectData and the special constructor). When deserializing, I find that the list is deserialized and contains the same ...

Serializable classes and name refactoring

On my current project, I am using FxCop to work through various code analysis warnings. For the Naming Rules, I have the option to either change names to match the rules or make the decision to keep my current spelling and suppress the warning. In regards to classes or attributes that are marked as [Serializable], I'm interested in the...

JavaScriptSerializer.Deserialize - how to change field names

Summary: How do I map a field name in JSON data to a field name of a .Net object when using JavaScriptSerializer.Deserialize ? Longer version: I have the following JSON data coming to me from a server API (Not coded in .Net) {"user_id":1234, "detail_level":"low"} I have the following C# object for it: [Serializable] public class Dat...

Is there any point Unit testing serialization?

I have a class that serializes a set of objects (using XML serialization) that I want to unit test. My problem is it feels like I will be testing the .NET implementation of XML serialization, instead of anything useful. I also have a slight chicken and egg scenario where in order to test the Reader, I will need a file produced by the Wr...

Using XmlEncoder to create delta/difference xml

Hi! The idea is the following: The XmlEncoder records the operations needed to reproduce the serialized bean starting from nothing. But what if we do not start from nothing? Can XmlEncoder be used to record the operations needed to transform an object to an other? And can XmlDecoder be used to make this transformation? Or is there an...

How can I perform serialization based on a contract or schema?

On my current project we are using both binary and xml serialization to store data that relates to user settings in a winforms application. Currently, we have two challenges: Serialization is being implemented via attributes on classes that also have business logic woven into them. It is difficult to re-factor these classes without af...

What's the best way to serialize / deserialize a Dictionary<String,String> in .Net 2.0?

I need to be able to serialize / deserialize a Dictionary to a human-readable (and if it comes down to it, human-editable) string (XML or Json preferably). I only need to work with String dictionaries, not other object types of any kind. The strings, however, are presumed to be free text, so they can have characters like single/double q...

Byte serialization

I recently had a discussion with a colleague about serialization of byte data over a network. He used the BinaryFormatter class to "unparse" the byte data I was sending to him. This did not work and he obviously had exceptional... exceptions. Binaryformatter could not "unparse" the data correctly since my data was simply a byte array. H...

Serialisation and Databasetechnics to locate objects

Hello there, I was wondering if there is a (c++ or D) serialisation library that also provides technics to locate a certain object (which was saved to disk) based to certain criterias like a certain attribute combination. I know about sqlite and mySQL and so own, but I search for an alternative. Because those databases are not bound to...

Set Only On Deserialization

Problem: I have a class, say Foo, that implements an Id property. Foo must be serializable. Foo.Id should be initialized to a new GUID on initialization of Foo. Foo.Id should not be changable once it has been set. Deserialization will attempt to set the Foo.Id, so it must be made Public. Private _Id As String=system.Guid.NewGuid....

Where does the term "serialization" come from?

I know what serialization is, but to me, this is one term that does not describe what it means. Why do we call serialization serialization? What is it about converting objects to raw data (and inflating/deserializing, for that matter) lends itself towards anything that related to the term "serial"? Who coined this term and why? ...

C#: How would you store arbitrary objects in an SQL Server?

Lets say you have various objects of arbitrary type that you would like to store in a key+value type of table. Key could for example be an int, string or guid. What would the value be? String, Binary or something else? And how would you store and load the objects? I would think some sort of serialization, but what kind? I have one so...

Can you specify format for XmlSerialization of a datetime?

I need to serialize / deserialize a datetime into yyyyMMdd format for an XML file. Is there an attribute / workaround I can use for this? ...

object from java client to WCF Web service, error deserializing

I have a .NET WCF Web service working great when called from another .NET app. Now I was trying to build a Java client to test the service but one of the methods won't work. I try to send a List of updates. The complex type is: <xs:complexType name="ArrayOfRegisterUpdate"> <xs:sequence> <xs:element minOccurs="0" maxOccurs="...

How do I serialize a mail message?

I get the following when tying to serialize a mial message using the los foratter. Error: Sys.WebForms.PageRequestManagerServerErrorException: Error serializing value 'System.Net.Mail.MailMessage' of type 'System.Net.Mail.MailMessage.' Is there an EASY way to serialize this object or am I going have to searialize each o fhte propertie...

Cannot find DataContractJsonSerializer from an Asp.Net Mvc application...

I can't get access to the DataContractJsonSerializer method from System.Runtime.Serialization.Json If I do: using System.Runtime.Serialization.Json; I get an error... How can I access this in my Asp.Net Mvc app so I can use the DataContractJsonSerializer method ...