serialization

How to send a System.Configuration.Configuration object trough WCF

Well I think the title explains for itself. I'm trying to export a configuration object trough the wire, but it looks quite difficult, the class is not serializable and... it's sealed, so no heritage here. As anyone did something like this before? Regards ...

C# Can't catch SerializationException

I'm having an issue in my program in the part that I'm loading a serialized file. I want to fail nicely if the file can't be deserialzed, but for some reason, my program will break rather than go into the catch clause. Here's my code using (FileStream fs = new FileStream(openFileDialog1.FileName, FileMode.Open)) { ...

String version of term_to_binary

I'm trying to write a simple server that talks to clients via tcp. I have it sending messages around just fine, but now I want it to interpret the messages as Erlang data types. For example, pretend it's HTTP-like (it's not) and that I want to send from the client {get, "/foo.html"} and have the server interpret that as a tuple containin...

ASP.Net MVC: how to create a JsonResult based on raw Json Data

Having a string containing the following raw Json data (simplified for the sake of the question): var MyString = "{ 'val': 'apple' }"; How can I create a JsonResult object representing MyString? I tried to use the Json(object) method. but it handles the raw json data as an string -logically :P-. So the returned HTTP response looks...

Why doesn't this struct serialize?

I have the following struct: public struct Declarations { public const string SchemaVersion = "urn:ean.ucc:gdsn:2"; } And the SchemaVersion is used by some XmlElements which are trying to be serialized like this: [XmlElement(Type=typeof(SomeGarbage),ElementName="moreJunk",IsNullable=false,Form=XmlSchemaForm.Unqualified,Namespace=Dec...

Utilizing A Devise Session Through Flex With Rails3-AMF

I have a Flex front end and a Rails 3 back-end that I would like to establish a session to. Before you can access the page embedded with the flex front-end, you are prompted with a html login page through Devise. I am able to login fine through the html page but cannot get access to the session with Flex using amf requests. I have the...

Which recommended Perl modules can serialize Moose objects?

I was usually using Storable with nstore, but now I have a module that has CODE and apparently Storable doesn't like that. I found YAML (and YAML::XS which I can't really get to work). I also experimented a bit with MooseX::Storage without much success. Are there other alternatives? What would you recommend? ...

Does C# have a library for parsing multi-level cascading JSON?

Is there a library (C# preferred) to resolve what I would call multi-level cascading JSON? Here is an example of what I mean: (Pseudocode/C#) var json1 = @"{ ""firstName"": ""John"", ""lastName"": ""Smith"" }"; var json2 = @"{ ""firstName"": ""Albert"" }"; var json3 = @"{ ""phone"": ""12345"" }"; var casc...

jQuery serializeArray doesn't include the submit button that was clicked

I have a form that has two buttons. One for saving a record and the other for cancelling the save procedure. I am using the rails.js (a common AJAX/jQuery plug-in for those of you not in the know) javascript file that works with jQuery for unobtrusive javascript/ajax calls. When I send the form data over ajax, I want the name and value ...

ANTLR rule to consume fixed number of characters

I am trying to write an ANTLR grammar for the PHP serialize() format, and everything seems to work fine, except for strings. The problem is that the format of serialized strings is : s:6:"length"; In terms of regexes, a rule like s:(\d+):".{\1}"; would describe this format if only backreferences were allowed in the "number of matches"...

WCF can't serialize cyclic references

I have a database with a lots of relationships between Tables and a Silverlight client that connects to my server with WCF service on ASP.Net side. First i used LINQ to SQL as a robust mapper tables to object and in a WebMethod that returns a List<Foo> of my Database's object(suppose GetFoo()). The Foo has lots of relationships with oth...

C# Deserialization problem into new class structure

I have a class and serialized into XML on hard disk. Then I add one new parameter into that class. Can I still able be de-serialize from old xml into new class structure by default de-serializer? Any things else might affect serialization? Rename parameters ? Delete parameters ? ...

BlazeDS serialization with complex types

I recently came into a situation when sending a nested object from Java to Flex via a HashMap the Objects were null. More precisely: final Map<Integer, List<String>> tempMap = new HashMap<Integer, List<String>>(); would send the keys as integers but the values were all null. But when sending the same with String keys: final Map<Stri...

How do I prevent WCF from auto-serializing byte-array as base-64 encoded string?

When invoking a service, my client code passes in data. One of the data members is a byte array, so WCF will automatically encode this into a base-64 string during serialization. The problem is, the data contract of the service is expecting a byte array, not a string, so deserialization of the data will result in an exception: Expecting...

NPE in java.util.LinkedList addBefore method.

Somehow, I'm getting a null pointer exception here with JDK 1.6.0_14: HttpSession session = request.getSession(true); LinkedList<MyObject> list = (LinkedList<MyObject>) session.getAttribute(MY_LIST_KEY); .... list.addFirst( new MyObject(str1, str2, map) ); Then, I get this: at java.util.LinkedList.addBefore(LinkedList.java:779) He...

Generic Object to '|'-separated string serialization

I have written this class-methods for .net 2.0 to create objects from '|'-separated strings and vise-versa. But the problem is, they are not giving right results in case of Inherted types, i.e. inherited properties are coming last and the sequence of the data supplied in the form of a '|'-separated string is not working. For example: ...

Serializing a C# Socket

I'm looking at options for optimizing the number of concurrent connections my socket servers can handle and had an idea that hinges on being able to serialize C# sockets so that they can be removed from memory and then restored as needed. This scenario is only acceptable for me because sessions last for hours and the sockets are used ve...

What are 'weak references' in KiokuDB?

What exactly are the weak references that KiokuDB tutorial mentions? How do they differ from 'normal' references? ...

How should I copy objects between two KiokuDB dirs?

I would like to make sure I get KiokuDB's scope concept correctly. Suppose I would like to load an object from db1 and store it in db2. Must I have both scopes 'open' at the same time? ...

Do I need to expose a constructor in a WCF DataContract for it to work during object instantiation on the client?

I have a class in a WCF service, lets call it A. A is a data contract, which contains as one of its DataMembers a collection of another custom object B. To avoid Null Reference problems on the client side, I instantiate the BList in the constructor like so: [DataContract] public class A { [DataMember] public String name { get; s...