serialization

.Net Binary Deserialization Failure detection/forensics for runtime platform

I'm looking for insight on how to instrument a runtime platform to expose the source type of a Microsoft .Net binary deserialization failure. When using BinaryFormatter.Deserialize(StreamingContextStates.CrossMachine) and one of the types does not exist in the current binaries; instead of throwing an error, .Net inserts the object [Type...

Exception while trying to deserialize JSON into EntityFramework using JavaScriptSerializer

I'm trying to deserialize JSON which I'm getting from an external source into an Entity Framework entity class using the following code: var serializer = new JavaScriptSerializer(); IList<Feature> obj = serializer.Deserialize<IList<Feature>>(json); The following exception is thrown: Object of type 'System.Collections.Generic.List1...

Java Web Start application gives MARSHAL exception when data loaded from database via remote EJB.

I have a Java Web Start application calling remote Java EE 5 EJBs to load in data from a database. When the data is returned from the EJB to the client, I get the following exception. Looking it up online, it seems that everyone gets this exception and everyone has a different solution for it. All of my entities (abstract or not) imple...

extract value from session value - using php unserialize, preg_split or other tool

I have a session variable that contains the following string. a:2:{s:7:"LoginId";s:32:"361aaeebef992bd8b57cb3e8d";s:8:"Username";s:6:"aaaaaa";} echo $_SESSION["SecurityAccess_CustomerAccess"]; I am trying to extract the username "aaaaaa". What combination of unserialize, preg_split or other will get me there fastest? attempts so far...

What's the clue to make stringstream write binary?

What I'm trying to do is, make the class message serialize and deserialize it's self. Not into or from a file, but into or from a binary sequence as a string or cstring. Message.h: class Message { private: int message_id; int sender_id; std::string sender_data; Message (); public: Message (int id, std::string da...

How to determine if all objects are serializable in a given namespace?

Some background: We require all of our DTO objects to be serializable so that they can be stored in session or cached. As you can imagine, this is extremely annoying and prone to error... is there any automated way (ideally as part of the build process) using Visual Studio 2010 to ensure that all classes in a namespace are marked with t...

Binary (De)Serialization of a stream of objects to 1 file

I am faced with the following problem. I need to (de)serialize (binary) a stream of objects to a single file on disk. Serialization part is not an issue, just open a stream in append mode and use .Net's BinaryFormatter Serialize method and you are done. The problem with this approach is that I can't just give this stream to BinaryFormatt...

Serialize/Encrypt/Transmit Web Form Data to Web Service

I have an ASP.NET 1.1 form gathering data on a public-facing site, within a DMZ. The data is represented by a serializable class. My problem is that I need to serialize, encrypt and transmit the data to a Web Service running on an internal server - the service logic should then decrypt and deserialize the data before writing the XML to a...

c++ - How to serialize an object to send over network

I'm trying to serialize objects to send over network through a socket using only STL. I'm not finding a way to keep objects' structure to be deserialized in the other host. I tried converting to string, to char* and I've spent a long time search tutorial, posts in internet and until now I found nothing. Is there a way to do it only with...

How Do I De-Serialize JSON From the Facebook Graph API?

So i'm trying to de-serialize the JSON returned from the Graph API OAuth Token call. The JSON looks like this: "[{\"access_token\":\"bunchofjsondatablahblah",\"expires\":9999}]" I'm trying to de-serialize it (using the DataContractJsonSerializer class) into this object: [DataContract] internal class FacebookOAuthToken { [Dat...

.Net and RelaxNG Schemas

Hello, a few weeks ago I started to use xsd.exe for create classes for serialization/deserialization xml files based on the xsd schema. Currently I am finding util like xsd.exe for create classes from RelaxNG Schemas. Can you help me to find it ? ...

Typedef Generalisation

Hi, I need to generalise a C++ typedef so I do not need to copy and paste a lot of code. I am serializing blitz arrays using boost and I am defining my own load and save methods and need to do this based on template parameters. Basically I don't know how to generalize typedef blitz::Array<double, 2> my_Matrix; for higher order te...

How to send an XDocument via MSMQ (using WCF)?

I have an order as an XDocument and I simply want to stick it in the body of a message and send it to an MSMQ queue. I've effectively serialized the order object already and now I just want to send it. Is this possible? I'm using WCF here but I'd happy with a plain old msmq solution. I'm getting an error here indicating that an XDocumen...

Trouble Serializing Enum in .NET

I have an elementary stumper using serialization in an ASP.NET 2.0 application on a C# class containing an enum property. It's my understanding that serialization of enumerations is supported if they map to integers. So, I can't figure out why I'm having this problem serializing/deserializing my enum. My Code: [Serializable] public c...

How to save and read user information (username ,password,and so on) by serializable ?

Is write all User information to only a file ,or every user has a self file ? And how to write information or read information of someone? ...

I'm looking for an efficient C object serialization Mechanism.

I'm looking for an efficient way to implement a serialization mechanism in C. I know it would be simple to just store the data in JSON, for example, and then reinitialize everything during the parsing. But I'm wondering if it is possible (or worth it) to write something that will just take my struct (containing dynamically allocated da...

How do you 'de-serialize' a derived class from serialized data?

Hello. How do you 'de-serialize' a derived class from serialized data? Or maybe I should say, is there a better way to 'de-serialize' data into derived classes? For example, suppose you had a pure virtual base class (B) that is inherited by three other classes, X, Y and Z. Moreover, we have a method, serialize(), that will translate X:...

Rename the property in json serialization

in Json.net we can rename the property with [JsonPropertyAttribute("")] , public class Foo { // how can I rename the Foo1 property name to F1?! public string Foo1 { set; get; } public string Foo2 { set; get; } } and in the web service code behind : [WebMethod] public List<...

How to store (and read) large arrays/maps/whatever in Java?

Can anyone help me with following problem? I need to permanently save what I today have in arrays, to later use the data for calculations. I explain an example below. 1, I generate a long[][] which is far too big for my computers RAM. It is generated one row after the other. 2, I calculate something from my long[][] and save the result...

Why is this type not serializable?

I'm trying to determine why this type isn't serializable (as tested by Type.IsSerializable()) <Serializable()> _ Public MustInherit Class WellKnownInstanceCollectionWithTypedId(Of T As WellKnownInstanceWithTypedId(Of IdT), IdT) Inherits ReadOnlyCollection(Of T) Public Sub New(ByVal list As IList(Of T)) MyBase.New(list) ...