serialization

Is there a way to serialize automatically enums as int?

Hello, Is there a way to serialize enums automatically as int? Every time I define a new enum and write std::stringstream stream; stream << myenum1; stream >> myenum2; the compiler complains that the operators << and >> are not defined. Do you know a way to tell the compiler to treat enums as plain int's? What makes the problem har...

XML Serialization

I am trying to serialize an ASMX web service result, but I get the following error. There is an error in XML document. ---> System.InvalidOperationException: <ArrayOfT_SATQuestionInfo xmlns='http://tempuri.org/'&gt; was not expected Any idea on how to fix this so it will 'expect' the namespace? ...

Serialization problem: Different namespaces (.NET)

We released a program that serializes a very complex object using the .NET soap formatter. Soap didn't handle new versions of the classes involved very well so we're switching to the binary formatter. To handle old object versions, I wrote a converter that deserializes the object in soap, and re-serializes it in binary. The converter ...

Are all public read/write members serialized with XmlSerializer?

I have a handful of public read/write members that are not being serialized and I can't figure out why. Reviewing some code, and my root class is marked serializable: [Serializable] public class MyClass I have a default constructor that initializes 10-15 string members. There are about 50 public read/write string members in MyClass wi...

Can objects be (de)serialized in richfaces xhtml?

Can Richfaces (de)serialize objects? Say for instance, I have a row of data being displayed in a richfaces table. Can I serialize the row of data to a string and later deserialize it back into a row? ...

Object to Network serialization - with an existing protocol

I'm writing a client for a server program written in C++. As is not unusual, all the networking protocol is in a format where packets can be easily memcopied into/out of a C++ structure (1 byte packet code, then different arrangements per packet type). I could do the same thing in C#, but is there an easier way, especially considering l...

PostSharp when using DataContractSerializer?

I have an Aspect that implements INotifyPropertyChanged on a class. The aspect includes the following: [OnLocationSetValueAdvice, MethodPointcut("SelectProperties")] public void OnPropertySet(LocationInterceptionArgs args) { var currentValue = args.GetCurrentValue(); bool alreadyEqual = (currentValue == args...

communication between 2 programs written in different language - Serialization ?

when is serialization,marshaling etc required during communication between programs residing across 2 different machines /network/Internet? Suppose I have a client program in java/flash and a server program in C. Can't I implement communication using a custom protocol of my own ? I guess so. When is serialization etc needed?I am aware J...

serializing JSON files with newlines in Python

I am using json and jsonpickle sometimes to serialize objects to files, using the following function: def json_serialize(obj, filename, use_jsonpickle=True): f = open(filename, 'w') if use_jsonpickle: import jsonpickle json_obj = jsonpickle.encode(obj) f.write(json_obj) else: simplejson.dump(obj, f) f.cl...

Avoiding duplicate objects in Java deserialization

I have two lists (list1 and list2) containing references to some objects, where some of the list entries may point to the same object. Then, for various reasons, I am serializing these lists to two separate files. Finally, when I deserialize the lists, I would like to ensure that I am not re-creating more objects than needed. In other wo...

Simple way to serialize ConfigurationElement into JSON

I need to take a portion of my xxx.config custom configuration and serialize it as JSON directly into my page. Using DataContractJsonSerializer yields {"LockItem":false} Which is similar to the response from XmlSerializer. I can't seem to find an override that gives me control over the serialization process on System.Configuration ...

Can protobuf-net serialize this combination of interface and generic collection?

I am trying to serialize a ItemTransaction and protobuf-net (r282) is having a problem. ItemTransaction : IEnumerable<KeyValuePair<Type, IItemCollection>></code> and ItemCollection is like this: FooCollection : ItemCollection<Foo> ItemCollection<T> : BindingList<T>, IItemCollection IItemCollection : IList<Item> where T is a derive...

Fast JSON serialization (and comparison with Pickle) for cluster computing in Python?

I have a set of data points, each described by a dictionary. The processing of each data point is independent and I submit each one as a separate job to a cluster. Each data point has a unique name, and my cluster submission wrapper simply calls a script that takes a data point's name and a file describing all the data points. That sc...

c# send recive object over network?

Hello, I'm working on a server/client project the client will be asking the server for info and the server will send them back to the client the info may be string,number, array, list, arraylist or any other object I found allot of examples but I faced issues!!!! the solution I found so far is to serialize the object (data) and send ...

NSKeyedArchiver to serialize to GPX XML

I have a Location class that contains a lat/lon as well as an elevation and timestamp: @interface Location : NSObject <NSCoding> { double lon; double lat; double ele; NSDate *time; NSDateFormatter *gpxDateFormatter; } I want to be able to serialize an NSMutableArray containing an arbitrary number of these Location objects into ...

Is there anything like ISerializable that works for XMLSerializer?

I've got a class which implements it's own (de)serialization via XLINQ, and I'd like to have clients of my class which attempt to XMLSerialze my class to have my XLINQ method called instead. Is that possible? ...

In Protobuf-net how can I pass an array of type object with objects of different types inside, knowing the set of potential types in advance.

I am trying to migrate existing code that uses XmlSerializer to protobuf-net due to the increased performance it offers, however I am having problems with this specific case. I have an object[] that includes parameters that are going to be sent to a remote host (sort of a custom mini rpc facility). I know the set of types from which the...

What is the "opposite" of request serialization called?

For example, if a request is made to a resource and another identical request is made before the first has returned a result, the server returns the result of the first request for the second request as well. This to avoid unnecessary processing on the resource. This is not the same thing as caching/memoization since it only concerns ide...

Howto serialize a List<T> in Silverlight?

I have a struct called coordinate which is contained in a list in another class called segment. public struct Coordinate { public double Latitude { get; set; } public double Longtitude { get; set; } public double Altitude { get; set; } public DateTime Time { get; set; } } public class Segment { private List<Coordina...

Is there a way to easily serialize form input into xml or yaml for database storage?

I am dealing with an old app in asp classic vbscript. I'd like to store the input of a form in a database text field as the form fields are a subject to frequent change and I don't feel like normalizing the old database. Any solutions for serialization in vbscript? Thank you! ...