serialization

XStream, CircularReferenceException

Please consider this code. Is it using Circular Reference? If not why am I getting CircularReferenceException, while enabling NO_REFERENCE mode in XStream. Anyone, please clarify the thing. @XStreamAlias("BalanceEnquiry") public class BalanceEnquiry extends EAIRequest { @XStreamImplicit private List<BalanceEnquiry.Detail> detai...

WCF Serialization & Interfaces

Does link text mean I have to return a concrete implementation? Even though I am using svcutil with the /r that includes my entites(where IMyInterface is defined). I get no errors but it changes all List(of IMyInterface) to list(of Object) and I cannot deserialize it on the client Error: list(of object) cannot be converted to list(of IM...

Type 'System.Web.HttpRequest' cannot be serialized

Hi There. I am trying to design an Picture Upload feature into a web site. I am using ASP.NET 3.5, C#, and WCF. I have been asked to accomplish the following: 1) Make the Uploader a Web Service 2) Return progress updates to the user as files are uploaded. 3) Log other relevant user-selected options in the database. So, I have s...

Deserializing using XElement

I had to write my own deserializer, because XmlSerializer and DataContractSerializer aren't good for my needs. So, here's the base of my deserializer: static BaseElement ParseXml(XElement element) { var e = (Element)Activator.CreateInstance(Type.GetType("Elements." + element.Name)); foreach (var attr in element....

(.Net) suggestions on making a config file for a program?

I'm not necessarily referring to app.configs, but a custom configuration file that would store my program's state whenever a user hits a "save" button. In my example, it's a UI builder that allows the user to choose which "fields" are to be displayed on the left and right columns in a two-column screen, along with the order of the field...

Which Json deserializer renders IList<T> collections?

I'm trying to deserialize json to an object model where the collections are represented as IList<T> types. The actual deserializing is here: JavaScriptSerializer serializer = new JavaScriptSerializer(); return serializer.Deserialize<IList<Contact>>( (new StreamReader(General.GetEmbeddedFile("Contacts.json")).ReadToEnd())); Befor...

C#, XML to Class DeSerialization Question

I have the following XML snippet: <dmFiles> − <dmFile dmUpFileGuid="" dmFileDescr="testcase01.pdf" dmFileMetaType="main" dmFileGuid="" dmMimeType="pdf" dmFormat=""> If I create a strongly typed C# class with string properties for the dmFile attributes (eg: dmFileDescr), how can I ensure these attributes will serialize to properties in...

C# XML deserialization problem

I have the following XML snippet: <?xml version="1.0" encoding="utf-8"?> <dmFiles> <dmFile dmUpFileGuid="" dmFileDescr="testcase01.pdf" dmFileMetaType="main" dmFileGuid="" dmMimeType="pdf" dmFormat=""> <dmEncodedContent></dmEncodedContent> </dmFile> </dmFile...

What is the easiest way to transfer a class with many dependecies in WCF (using shared DLLs)?

I've got a class which has properties referenced to couple of interfaces and classes. Now I'm trying to transfer this one class via WCF (named pipes), what's the best way to deal with it? Shall go into all referenced interfaces, class and mark stuff as <DataContract()>, <Serializable()> and <DataMember()>, which means at least 6-10 c...

How to speed up serialization code?

I have the following code that serializes a List to a byte array for transport via Web Services. The code works relatively fast on smaller entities, but this is a list of 60,000 or so items. It takes several seconds to execute the formatter.Serialize method. Anyway to speed this up? public static byte[] ToBinary(Object objToBinar...

How can I deserialize an interface type?

I serialize a class which includes a property called Model as IModel but when I try to Deserialize it I'm getting the following exception: System.Runtime.Serialization.SerializationException: Type 'MYN.IModel' in Assembly 'MYN.Defs, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' is not marked as serializable. It's binary seria...

Putting Eclipse plugin on System classpath

I am trying to desrialize an object of type A located in plugin C. Although my plugin has the proper dependency on plugin C which has type A and can also create and instantiate an object of type A, when I try to desiralize an object of type A, it fails. The reason I believe is that the java.io.* classes which are actually doing the d...

How to use Binary Serializing to store as a string?

Basically I want MyObject to be serialized into a string using Binary Serialization. Is this possible? If so, how to do this? Same for deserialization, from string to MyObject. ...

Why does Binary Serialization require the object to be marked as serializable?

I was using the xml serializer but when I switched to binary serialization, it throws an exception: -- Runtime error: dotNet runtime exception: Type 'MyTypes.MyObject' in Assembly 'MyTypes, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' is not marked as serializable. Why is it different than an xml serializer in the way it ask...

.NET 2.0 Client fails to deserialize valid Apache-SOAP web service XML, shows null for all properties

A coworker has made a Java web service running on the Apache-SOAP runtime on a Tomcat 6 server, but only tested it using Eclipse's built-in tool and SoapUI. The output of this service is an array of objects which are each composes of five string fields. I need to write a .NET client to consume this service, and I used Visual Studio 2005 ...

Change the order of property serialization at design time in .Net

I have a class where it's problematic to relay on the properties being serialized in alphabetical order at design time. In other words, property Z must be serialized before property A. The problem arises because property property Z clears property A whenever it changes - which happens in InitializeComponent. I work around this problem b...

Creating XML file in c#

I like to create a xml file with following structure... <Disposition> <DispositionTextList Description=""> <DispositionText value=""> <DispositionText value=""> </DispositionTextList> <DispositionTextList Description=""> <DispositionText value=""> <DispositionText value=""> ...

how to send data over network fast?

i have lots of data like this 1:0x00a4c7d9fb3849... 2:0x79821309bd789c7689c97... 3:0x0178dce67fe898... they are more than 100 per second and speed is the most important thing(network is always busy). what should i use to transfer my data(tcp/ip, pipes, via, etc)? how should i serialize it(BinaryFormatter,Xml,User defined or any better ...

Best Serialization for a scenario where performance is paramount and data form is unimportant in .NET?

Which serialization should I use? I need to store a large Dictionary with 100000+ elements, and I just need to save and load this data directly without caring whether it's binary or whether it's formatted or not. Right now I am using the BinarySerializer but not sure if it's the most effective? Please suggest better alternatives in th...

Which serializer is most forgiving for changes to the serialized types in .NET?

I noticed the XmlSerializer is more forgiving to adding new members, removing existing ones, etc to the serialized types. When I did this with the BinaryFormatter, and tried to deserialize the old data, it threw an exception. What other alternatives are there for forgiving options, i.e. one that doesn't throw an exception just uses def...