serialization

How to use list/array of some object inheritance with Protobuf/Protobuf-net ?

Using Protobuf/Protobuf-net and two classes, one base class and the other derived from the base. How would you serialize/deserialize a list ? For instance: public class SomeBase { ... } public class SomeDerived : SomeBase { ... } And the following field to be serialized: public List<SomeBase> SomeList; Keep in mind that t...

ToolStripControlHost hosting a UserControl designer Serializing won't occur

I am currently developing an application in which I want to display a UserControl inside a context menu. I was able to (somewhat achieve this using ToolStripControlHost). Shown in (NumericUpDownToolStripItem code): below is code for the object (written in VC++.net 2.0). Note: There are semi-similar SO questions on this, but none seem ...

PHP - Check to see if a string is serialized?

What's the best way to determine whether or not a string is the result / output of the serialize() function? ...

Shadowed property in ASP.NET UserControl does not gets serialized

Hi All, I have a one more question on ASP.NET UserControl. Assume I have a user control MyUserControl that exposes BufferCapacity property. The control internally maintains an array of size BufferCapacity. Now at design time I have shadowed this property. But if I change the proeprty, the value is not getting serialized in the *.aspx co...

Serialization, deserialization of void pointers

I would like to store a void pointer in a blob for a record in a table. How do we do the serialization and deserialization? ...

Is there a reason to use a real serialVersionUID?

This question is an exact duplicate of: http://stackoverflow.com/questions/888335/why-generate-long-serialversionuid Ironically, answered by Michael Bogswardt as well. Michael Bogswardt's answer to generating a serialVersionUID got me thinking. Is there any reason to generate a proper serialVersionUID like eclipse and IDEA (or j...

Can I Deserialize a JSON string into an object if I only know the parameters of the objects' constructor?

This is like a follow-up question to this one. Basically what I'm doing is exposing some fields on some UI to some user. These fields are established based on the parameter list of a given objects constructor. The user has the options to choose which object the UI is displaying by, oh I don't know, let's say picking an object from a dr...

Java: Use ObjectOutputStream without serializable

Hello, Sometimes, I want to use an ObjectOutputStream to write something to a file or sending a little image over the network. But BufferedImage and many other classes not implement java.io.Serializable and then the Stream cancels writing. Is there a way avoid that? Thanks, Martijn ...

.NET deserialization - using different assembly

I've got a problem I can't find any solution for. I have a textfile containing Serialized objects. I need to extract that data. I have the code of class that was used to serialize and the entities but not the original assembly. I can't deserialize this because the serialization class wants the exact same assembly to deserialize as the o...

Getting XML serialization to automagically ignore non-serializable properties

I'm using the .NET serialization classes to XML serialize and log argument values that get passed to certain functions in my application. To this end I need a means to XML serialize the property values of any classes that get passes, but ignoring any properties that cannot be XML serialized (e.g. any Image type properties). I could go t...

On $.Post in Json used in ASP.NET MVC 1.0 i am getting exceed maxlength error

i am getting this error given below i guess its a max length exceed error when i call a action in a controller using $.post method can you tell me what setting should i put to increase the length System.InvalidOperationException: Error during serialization or deserialization using the JSON JavaScriptSerializer. The length of the string...

Transfer or serialize assembly

I need a way to transfer a compiled assembly from client to the server and be able to store that in the database or in a file in such a way that I can grab those bytes on the "to" side and re-load assembly. Is there a way to do it. To clarify, I have a winforms application that will generate code and compile it based on some metadata. No...

protobuf.net not serializing zero

Hello It looks like there is an encoding problem for 0 as Int64. Other values as Int64 ok. [ProtoMember(3)] private readonly Int64 _intValue is deserialized as Int64.MinValue Any idea? I confirm the bug. This class will not serialize properly if _val == 0 [ProtoContract] class VerySimple { [ProtoMember(1)] private readonl...

Load Multiple XML Elements into Object using Serialization in C#

I am trying to load multiple elements with the same name from XML into a class using deserialisation in C#. Everything in my example loads fine but the array elements (Element3) are not populated. Code: class Program { static void Main(string[] args) { FileStream file = new FileStream("service.xml", FileMode.Open); ...

XML Serialization/Deserialization in C++

I am using C++ from Mingw, which is the windows version of GNC C++. What I want to do is: serialize C++ object into an XML file and deserialize object from XML file on the fly. I check TinyXML. It's pretty useful, and (please correct me if I misunderstand it) it basically add all the nodes during processing, and finally put them into a...

Returning DataTable objects with WCF service

This is a strange problem that I am having with WCF trying to send DataTable in the response. I have the following service contract: [ServiceContract] public interface ISapphireDataService { [OperationContract] DataTable LoadData(string query, DateTime start, DateTime end); [OperationContract] string LoadDataTest(); } ...

WCF Ajax service - How can I pass an Array or JSON to the service? What should the method parameter type be?

I have a very simple WCF service I would like to pass it an array or json? [OperationContract, WebGet(ResponseFormat = WebMessageFormat.Json)] public string GetPreDisplay(string inputData) { //DoSomething with inputData return "Sweet!"; } My javascript... var data = [paymentControls['claimNum'], paymentCo...

How can I configure ASP.NET web service to only send LocalDateTime property of DateTimeOffset object as JSON?

I have a bunch of entity class (generated by Linq to SQL) with a few DateTimeOffset properties in it. When I send that over the wire as JSON from a .asmx web service, the JSON serializer generates the following JSON: {"DateTime":"\/Date(1252142834307)\/", "UtcDateTime":"\/Date(1252142834307)\/", "LocalDateTime":"\/Date(1252142834307...

WPF TypeConverter ConvertTo not firing

Hi, I have a dependency property in a class which I need to be converted to a string. I have added the TypeConverty attribute on the property. The type I am converting is the .net Style class. [TypeConverter(typeof(BulletStyleTypeConverter))] public Style BulletStyle { get { return (Style)GetValue(BulletStyleProper...

Storing a field in FluentNHibernate using one type, but accessing through methods as another type

I am creating a message queue in a database. Each queued item stores a ID and a couple of other things. But the key field is IncomingMessage. In the database I am storing a serialized version of the IncomingMessage because it can be one of a number of types (like NewWorkorderMessage or EmployeeStatusChangeMessage). So the field in my Que...