serialization

Tools for debugging / checking XML Serialization

Are there any tools out there for helping to debug / check the xml serialization process? For instance, suppose an item is marked as internal instead of public. There is no compile time error message, nor a runtime error message. If you set a breakpoint and step into the serialization process, the item is just just skipped. In other ...

Are there C++ equivalents for the Protocol Buffers delimited I/O functions in Java?

I'm trying to read / write multiple Protocol Buffers messages from files, in both C++ and Java. Google suggests writing length prefixes before the messages, but there's no way to do that by default (that I could see). However, the Java API in version 2.1.0 received a set of "Delimited" I/O functions which apparently do that job: parse...

Deserializing properties into a pre-existing object

Is it possible to deserialize object properties, using any of the standard serializers, without creating a new object? Problem is, the objects in question are very complex (they can only be created by a special factory, and their types are dynamically generated at runtime), but they have some known properties, which I would like to stor...

Jquery/C# Making a webService call errors out: cannot be serialized because it does not have a parameterless constructor

Here's my call: CallMfttService("ServiceLayer/FieldingManager.asmx/GetUICs",null, SetUicValues); Here's the WebMethod: [WebMethod] [ScriptMethod] public List<string> GetUICs() { UserManager user = new UserManager(); var currentUser = user.GetUser(Security.FieldingToolPrincipal.Current.Identity.Name); ...

Serialize superclass of object in Java

I am looking for a way to serialize a class in Java into it's superclass, and then convert it to a byte array and send it over a network. Here is an example: class SuperClass { public int number1; } class SubClass extends SuperClass { public int number2; } I don't think it's possible to simply cast an object of SubClass into...

Deserialize from string instead TextReader

Hi, I wanna change my code from: string path=@"c:\Directory\test.xml"; XmlSerializer s = new XmlSerializer(typeof(Car)); Car car; TextReader r=new new StreamReader(path); car = (Car)s.Deserialize(r); r.Close(); into Code that would convert a xml to string , and then convert string to object car. Is it possible?? ...

How to save a datatable if it contains an object that refuses to serialize?

Hello expert coders, I'm storing GData "Event" objects from the Google API in a datable (Ok, I had to cast them as an object or they wouldn't go in), and I can access all the properties of the events perfectly, and use them to update Google, but I cannot serialize the datatable (or a parent dataset) to file because: Type 'Google.GData.C...

Does datacontract serialization uses reflection?

XmlSerialization creates a serializer proxy for each class. The proxy resides in a different assembly so it can serialize only public fields. DataContract serialization can serialize private fields too. Does it mean it uses reflection? Isn't it slower than using a proxy (except for the first time)? ...

Writing a VBScript serializer

I need a purely text serialization of an object in VBScript. Does VBScript provide any built-in support for serialization or is it up to me to enumerate the properties and put them in a string? ...

Initialize an object of type T from Dictionary<string,object>

I'm looking for more generic/"standard" way to instantiate object of some type T from set of pairs string,object. For me it looks like there should be some well known way to do it but I cannot find it, so I come up with this piece of code. Does anybody know something better? // usage public class test { public int field1; p...

How can I deserialize the object, if it was moved to another package or renamed?

Consider the following situation: There is a serialization file, created by the older version of the application. Unfortunately, the package has changed for the class, that has been serialized. And now I need to load the information from this file into the same class, but located in different package. This class has serialVersionUID def...

Reading Java serialized object that has been split across two files?

I'm writing an Android application. One problem is your app cannot contain a file whose uncompressed size is bigger than about 1Mb. I have a serialized object that I want to load that totals about 2Mb. My plan was to split this file into two smaller files, then load the object by combining both files at runtime. However, I cannot work o...

Pickled Object Versioning

I am working on a project where we have a large number of objects being serialized and stored to disk using pickle/cPickle. As the life of the project progresses (after release to customers in the field) it is likely that future features/fixes will require us to change the signature of some of our persisted objects. This could be the a...

serialize in .NET, deserialize in C++

Hi All. I have a .NET application which serializes an object in binary format. this object is a struct consisting of a few fields. I must deserialize and use this object in a C++ application. I have no idea if there are any serialization libraries for C++, a google search hasn't turned up much. What is the quickest way to accomplish th...

Office Addin terminates host while using WCF

It took some time to solve this and the conclusions are interesting. Our Office (Word/Excel/PowerPoint) add-in sends a request to our custom WCF service, the hosting Office application terminates, leaving this entry in the application log: Provider: .NET Runtime EventID: 1023 Level: 2 Task: 0 Keywords: 0x80000000000000 Channel: Appl...

Can encode/decode a Image Object to keep it in a XML file using Compact Framework?

As the title mentioned, I want to encode a Image Obj into some kind of text data (compact framework not support binaryformatter, correct me if I'm wrong). So is there any way to encode a Image Obj into text data and keep it in a XML file for being able to decode from XML file to Image obj later? UPDATE: Here is what I did following Sam'...

Powershell's import-clixml from string

Is there any way to run import-clixml cmdlet on a string or xml object? It requires a file path as input to produce ps objects and can't get input from an xml object. Since there is convertto-xml cmdlet which serializes ps object into xml object, why isn't there a convertfrom-xml, which would do the opposite? I am aware of System.Xml.Ser...

How to get the content of a RichTextBox?

I would like to get the content of a RichTextBox as a string wich contains the XAML. I seen some post wich show differents solutions with another class for parsing the xaml and transforms it into a stringbuilder. But, my goal is to have the XAML directly generated. Thanks ...

Get the XMlNode content from object marked as serializable

I have a class Image implementing ISerializable: [Serializable] [XmlRoot(ElementName = "IMAGE")] [TypeConverter(typeof(ImageTypeConverter))] public class ImageResource : ISerializable { [XmlAttribute(AttributeName = "TYPE")] public string Extension{ get; set; } } I just want to know if we can get the xml no...

serialize without a form?

Hello all i'm turning objects "on (adding the class .active) and off" on a html page with html objects, not forms. And on every click i want it to create an array of the items with the class .active but i can't seem to get any results?! is this in the right direction? var data = $('li.tagToggle.active').serializeArray(); // li id forma...