serialization

Why am I using the KnownType attribute wrong?

I am trying to deserialize a json response from a google api, so i thought i would define a couple classes to help with it: [DataContract] public class DetectionResult:ResponseData { [DataMember(Name="language")] public string Language { get; set; } [DataMember(Name="isReliable")] public bool IsReliable { get; s...

PHP Complete Object Graph not stored in Session

Hello, I have read other posts on stack overflow on the issue but my question is a little different.. When storing an object in the Session does PHP save the Complete Object Graph in the session? I am having problems accessing some of the properties of the Object AFTER it is read from the Session. The object i am storing has complex...

Serialization of Method object in Java is possible?

I'm getting this error when I try to serialize a Method object. java.io.NotSerializableException: java.lang.reflect.Method Any Idea? ...

is there a difference between [Serializable] and [Serializable()] in c#?

Hi, I've bumped into examples using either of both notations. I can't find anything about it what tells which one is the common one, why 2 notations are allowed, and if there is actually any subtle difference between the two. anyone an idea? ...

How to get fields from such a string?

I'm importing some data from a database. The data has been stored by a CMS written in php where I have no control. Here is the data (a dense report from a paypal response): a:56:{ s:8:"business";s:19:"[email protected]"; s:14:"receiver_email";s:19:"[email protected]"; s:11:"receiver_id";s:13:"KVBRSDFJKLWYE"; s:9:"item_name";s:4:"ABC...

How can I find which object in ASP.NET can't be serialized?

I'm getting the following error in my application: Unable to serialize the session state. In 'StateServer' and 'SQLServer' mode, ASP.NET will serialize the session state objects, and as a result non-serializable objects or MarshalByRef objects are not permitted. The same restriction applies if similar serialization is ...

XML deserialization group of objects

This is XML document: <?xml version="1.0" encoding="utf-8" ?> <ToolBars> <ToolBarSet id="1" buttonsCounter="4" width="252"> <ToolBarItem id="1" Command="Command11" Icon="pic11" Enabled="true" Visible="true" /> <ToolBarItem id="2" Command="Command12" Icon="pic12" Enabled="true" Visible="true" /> <ToolBarItem id="3"...

C# - Event handling goes weird after I use serialization with my program

I have object A and object B deserialized from binary files. B has a private method which is used as a callback function and does some manipulation on a private data member when A raise an event. To clarify the basic structure: Class A { private static A instance; public static A GetInstance(){...}; private A(){} public...

Serialization to Disk inplace of creating a simple database... Is there a pattern or industry name for this approach?

I am leading a development team of 5 or so developers and we have a need to persist a small amount of data. I am thinking we do not need to employ a full DB engine and instead we can simply serialize our data to disk. We would serialize our collections of object to and from disk as needed at runtime instead of to a DB where we have to ...

Explanation of serialization in Java

Can anyone explain working of serialization in java ...

Can't Deserialize a Nullable KeyValuePair from JSON with ASP.NET AJAX

The following class does not deserialize (but does serialize) using System.Web.Script.Serialization.JavaScriptSerializer. public class foo { public KeyValuePair<string, string>? bar {get;set;} } The attempt to deserialize results in a System.NullReferenceException when System.Web.Script.Serialization.ObjectConverter.ConvertDictionar...

Boost Serialization Compile Errors, terribly confused

Okay so basically : i have this simple example: main.cpp using namespace VHGO::Resource; std::list<BaseTable*> tableList; BigTable* bt1 = new BigTable(); HRESULT hr = S_OK; hr = bt1->Add(L"TEXTURE", L"..\\Data\\ground.png"); tableList.push_back(bt1); std::wofstream ofs3(L"VHGOSatData.bif"); boost::archive::xml_woarchive outArch3(of...

Weird behaviour of a deserialized class

I've got a huge XML file that's being deserialized by XmlSerializer in an XSD-generated class structure. Everything used to work just fine, but now a weird thing started happening. Sometimes (50% of runs) a field of a certain object of a class that's deep in the class tree just changes to a certain value of the same field of a different ...

Are all Serializable classes valid for WCF methods parameters and/or Data Contract members?

I am in the process of porting some .net remoting code to WCF. Can I safely assume that all classes that are Serializable and works as .remoting method parameters will work with WCF using the binary message encode? If not is there a “rule of thumb” that I can use to estimate what problems I will hit? ...

.Net Remoting - Serialisation of Delegates

I have written a custom remoting formatter sink for an established application. The formatter appears to work for most cases until I try to use it to call a remote method to which I pass a call-back to a CAO. At this point I get a SerializationException indicating that I am trying to serialise the CAO, which is obviously not what I want ...

What are the pros/cons of using AMF vs. serializing data between Flash and a web script/service?

I was using the serializing approach between Flash and PHP for the longest time before AMFPHP had its 1.0 release (wow...that was a long time ago...in 2006)! Serializing using a sepiroth's AS library paired with PHP's built in serializing functions worked and I didn't change it because it did the job. Should I switch over to the AMF fo...

How can I ignore a property when serializing using the DataContractSerializer?

I am using .NET 3.5SP1 and DataContractSerializer to serialize a class. In SP1, they changed the behavior so that you don't have to include DataContract/DataMember attributes on the class and it will just serialize the entire thing. This is the behavior I am using, but now I need to ignore one property from the serializer. I know that...

How to deserialze a binary file

I'm having some trouble figuring out how to deserialize a binary file. I mostly can't figure out how to use the second argument of SerializationInfo.GetValue(); - if I just put a type keyword there, it's invalid, and if I use the TypeCode, it's invalid as well. This is my current attempt (obviously it doesn't build). protected Grou...

Does Java Serialization work for cyclic references?

For example: Object A contains Object B that contains Object C that contains Object A. Will Object A serialize properly? Comment #9 here indicates that it does not work . In contrast, XStream indicates that it does handle cyclic references. ...

How do I PHP-unserialize a jQuery-serialized form ?

Using $('#form').serialize(), I was able to send this over to a PHP page. Now how do I unserialize it in PHP? It was serialized in jQuery. Thank you !! ...