I'm a bit out of my element. I've used xsd.exe to create an xsd schema from an xml file, and then to create a C# class from that xsd. That all seems to work fine.
At the moment I'm just trying to get the XML deserialized. The file I'm deserializing if the very same file I used to build the class originally. Here's my code:
String xsdPa...
How to serialize Multiple Objects of the same Class into a single file and Deserialze into Those objects in c#
...
Is there a way in C# to serialize a struct to a binary stream (MemoryStream) such that the binary representation is equivalent to how the struct is visually layed out (i.e. no padding)?
In C/C++, you use #pragma commands to tell the compiler to pack the struct's so that there is no padding between the fields. This is helpful if you hav...
What is the difference between Serializable and Externalizable in Java?
...
Hello,
I have an NSMutableArray that holds objects of the type Person (NSString,NSString,int)
I am looking for a easy way to save this array to disc and load it again later.
I read alot about serialization but I never have done that. Maybe it's not the easiest way for me after all.
...
I've got this class being provided by a web service that is then being consumed by a Silverlight app (I don't know if that's relevant or not)
[Serializable]
public class Entry
{
private string _title;
public string Id { get; set; }
public string Title { get { return _title; } set { _title = value; } }
public string Link { get; set;...
I have 2 interfaces IA and IB.
public interface IA
{
IB InterfaceB { get; set; }
}
public interface IB
{
IA InterfaceA { get; set; }
void SetIA(IA value);
}
Each interfaces references the other.
I am trying to serialize ClassA as defined below.
[Serializable]
public class ClassA : IA
{
public IB InterfaceB { ge...
I have two application that need to talk to each other. App1 needs to be able to serialize an object that App2 can then deserialize. Easily done, right? Here's the problem; App1 is C# based, App2 is Java based. So App1 needs to write out the file in the Java binary file format. How can this be done?
The way I see it, I have two options....
i am trying to create a mock shopping cart for a uni project. im using two java classes Item and shoppingCart, shopping cart uses a vector to store Items and then writes them to a file. i am trying to use the classes on a jsp page but when i try to write to the file i get an java.io.WriteAbortedException: writing aborted; java.io.NotSeri...
I've instantiated a class that is serializable, and I'm serializing it to a file, but it is always putting the following attributes in my root element:
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
How can I stop that?
...
Hi to all,
I need to save the context of the program before exiting ... I've put all the needed stuff to an object that I've previously created a I tried many times to picke it, but no way !!
I continuously have errors like :
PicklingError: Can't pickle 'SRE_Match' object: <_sre.SRE_Match object at 0x2a969cd9c0>
OSError: [Errno 1] Oper...
I have to implement ISerializable in a derived class (to do some custom serialization/deserialization) but the parent class is marked as [Serializable]. The serialization "works" (I can serialize and deserialize without runtime errors) but it looks like the base class data isn't being preserved.
Is the fact that I'm implementing GetObj...
I have two projects: A/B. Project A is the project that contains all of the winforms which are bound to objbects in B (logic items)
A has an object of type
A.Form
B has objects of type
B.Serializer
B.Logic
Now, A has a reference to B (but B does not have a reference to A) and A.Form contains a member variable of type B.Logic. At some...
I have an Application (an appointment manager) which lets the user create usercontrols in a stackpanel per button click and the user can enter data into the usercontrols. So far so good.
I serialized the stackpanel with XamlWriter.Save(). But then when I try to load it again the next time the application starts with XamlReader.Load() I ...
I'm parsing an XML document that has nodes like the following:
<objects>
<dog>
<data1>...</data1>
<data2>...</data2>
<data3>...</data3>
</dog>
<cat>
<data1>...</data1>
<data2>...</data2>
<data3>...</data3>
</cat>
</objects>
The elements data1, data2, data3 are always consistent. Only the parent tag vari...
I'm using XStream and JETTISON's Stax JSON serializer to send/receive messages to/from JSON javascripts clients and Java web applications.
I want to be able to create a list of objects to send to the server and be properly marshalled into Java but the format that XStream and JSON expect it in is very non-intuitive and requires our javas...
I need to serialize a .NET DateTime value in a protocol buffers message.
My plan is to use the DateTime.ToBinary() and then pass the 64-bit returned value in the message. But I'm not sure what to choose as a protocol buffers data type to represent that.
I guess I'm confused about when the fixed64 (or sfixed64) data types should be use...
Does one of the mainstream JavaScript libraries (YUI, jQuery, Dojo) provide a way to serialize a JavaScript object to XML (as text)?
...
I'm looking to persist an object to a single column using NHibernate. I'd like to serialize the data on the way in into a single column, and then deserialize it on the way out. This could be binary or xml. How can I go about doing this?
...
I'm getting a xml file from one vendor that has some "empty" dates like this:
<UpdatedOn/>
<DeletedOn/>
By doing a regular deserialization it fails with:
Inner Exception: System.FormatException: String was not recognized as a valid DateTime.
Any ideas how to deal with this ?
My fields are already marked for a default DateTime:
...