serialization

Writing an object to XML

What ways there are for doing a one way XML serialization in .Net? XmlSerializer won't write properties that don't have a public setter. While this limitation is understandable for deserialization I would be satisfied with just serialization for web use. The JSON.Net serialization works great in this situation as it serializes the full o...

C# Storing Binary Stream (or byte Array) in Resources

I am guessing, as Images and Icons are stored in a resx file, I am guessing that it should be relatively easy to store a byte array (or similar stream) in an embedded Resource file. How might this be done, should I pretend the binary stream is a Bitmap, or if the Resource file is the wrong place to be embedding binary data, what other t...

serialization and externalization in java

Possible Duplicate: What is the difference between Serializable and Externalizable in Java? what is the difference between serialization and externalization in java? ...

How to analyze binary file?

I have a binary file. I don't know how it's formatted, I only know it comes from a delphi code. Does it exist any way to analyze a binary file? Does it exist any "pattern" to analyze and deserialize the binary content of a file with unknown format? ...

How can I build XmlDocument with many xml namespaces in a single node?

I'm trying to build XmlDocument so that after serialization I could achieve something like this xml: <?xml version="1.0" encoding="UTF-8"?> <wnio:element xmlns:wnio="somuri" xmlns:xf="abcd"> <xf:nestedelement>somtext</xf:nestedelement> </wnio:element> The things is that XmlElement allows to specify ONLY ONE namespace via NamespaceU...

GWT Visualisation API DataTable Serialization

I am trying to follow this tutorial on how to connect to a database in GWT, but instead of creating a login program, I am trying to retrieve a GWT Visulation DataTable from my DB so that I can then create a Annotated TimeLine. I have gotten very far, but I hit the final wall I can't figure out. Unlike the tut, I am not returning a simpl...

serialize and sync data on embedded device

In my embedded project I have to move(sync) data between two systems. The data structure is complex and hence need some quick utility.I guess i should convert my data to XML format and sync it using rsync ? Boost is not going to be there on our embedded platform. Could someone suggest lightweight yet efficient library to convert my da...

Cleaner way to deep copy an AutoGenerated WebService Class

I am currently using Serialization in order to make deep copies of some autogenerated webservice class. Is a cleaner way to do this? The classes are autogenerated, so I don't want to touch them. More detail: My current, code (which works fine) is this: using (Stream stream = new MemoryStream()) //Copy IR { IFormatter IF = new Bin...

C/C++ Memory Problem?

Hi there, Programming for my Arduino (in some kind of mix of C/C++), I noticed something weird. Everytime I communicate through the serial port, I keep an eye on the SRAM usage. Normally, it ranges between 300~400 bytes. However, after adding a new routine (see below), I noticed it always jumped from 300~400 bytes of free memory to EXA...

Send a structure through a socket using tpl for serialization using c

After reading a few related questions I've decided to use the tpl library to serialize my structures in order to send and receive them through sockets. I'm having trouble understanding how to send and receive the tpl images using sockets. I get a segfault error on the server side when I call the tpl_dump function. I know the sockets ar...

What's the most efficient way to store objects in a SQLCe Database?

I need to increase the performance of a compact framework application which uses a SQLCe database to persist cached objects between sessions of the application. Currently, objects are serialized into XML and stored in a SQLCe database, but having run a profiling tool it seems that there is quite an overhead in doing this. I was thinking ...

Providing serialization services in a base class that can be used in derived classes

I've implemented a data access library that allows devs to mark up their derived classes with attributes to have them mapped directly to stored procedures. So far, so good. Now I'd like to provide a Serialize() method or override ToString(), and have the derived classes get free serialization into XML. Where should I start? Will I have ...

.NET 1.1 WSDL - Unable to use IntPtr (WindowsIdentity.Token) as input param on WebMethod (ASMX Web Service)

We're in a strange situation with a legacy winforms VB.NET 1.1 application using ASMX web services. Trying to send a user Token from a WindowsIdentity object as a parameter to a WebMethod. I will be adding a 'HACK: comment. System.Security.Principal.WindowsIdentity.GetCurrent().Token The token is of type IntPtr, the first problem is t...

Json.NET serialization pre and post calls

Hi, I am using Json.NET to serialize an object graph. For each object that is serialized or deserialized, I want to call a method on that object before the serialization takes place. For e.g. all my objects implement an interface INotified with a method OnSerializing. I want OnSerializing to be called before the object is serialized. I...

What needs to be Serializable in this Java situation?

I've got a class Thing: public abstract class Thing { // prevent instantiation outside package. Indeed, no Things will // ever actually have a runtime class of Thing Thing(){}; public static Thing create() { return new SpecialThing1(); } public static Thing createSpecial() { return new Speci...

Strange exception when calling code in a web service vs a windows exe

I'm interoping with some com objects in a web service using code shared with a windows app. The window apps has no problems interoping with the com objects but the web service throws this exception 'Type 'MapShots.FODDs.ilfFOD.fodDescriptions' in Assembly 'ilfFOD, Version=1.1.1.0, Culture=neutral, PublicKeyToken=null' is not marked as...

How to design to prompt users for new values for properties of deserialized objects?

Right now, I'm currently serializing a class like this: class Session { String setting1; String setting2; ...etc... (other member variables) List<SessionAction> actionsPerformed; } Where SessionAction is an interface that just has one method. All implementations of the SessionAction interface have various propert...

A tricky javascript question

I'll probably best explain this through code. I got something like this: var object1 = function(){ //do something } var object2 = function(){ //do something else } var objects = { 'o1' : object1, 'o2' : object2 }; var actions = []; function addAction( actionName ){ var object = objects[actionName]; actions.push( functio...

Generic IPropertyChangedNotifier using Dynamic Proxy and wcf serialization problem

I have implemented a generic IPropertyChangedNotifier using castle dynamic proxy. Here I intercept setter call in Proxy objects so that i don't have to raise PropertyChanged event in setters of my domain objects. The purpose was to use these proxy objects to bind it UI in a silevrlight application. The Problem is serialization of prox...

how to serialize Linq-to-SQL DataLoadWith.LoadWith when using it thru WCF?

In one of our project we're using Linq-to-SQL to get data from our database. There are a lot of tables that have references to others. We're using the LoadWith method to get a hold of that data. The data is than serialized and send to a client application using WCF. On the cliend the references are gone. When stepping thru the code and w...