serialization

WCF Xml Serialization and AutoImplemented Properties

I'm experimenting with WCF RESTful web services and I'm having a problem with Auto-Implemented properties. I have a class called DeviceDescriptor, defined as follows: public class DeviceDescriptor { public string DeviceId { get; set; } public string DisplayName { get; set; } } I have a RESTful WCF service that is supposed to ...

how to design messages in a java client-server model

hello i have set up a basic client and a basic server using java sockets. it can successfully send strings between them. now i want to design some basic messages. could you give me any recommendations on how to lay them out? should i use java's serialzation to send classes? or should i just encode the information i need in a custom st...

AccessViolationException when serializing a struct of arrays of structs?

I have a sequential struct that I'd like to serialize to a file, which seems trivial. However, this struct consists of, among other things, 2 arrays of other types of structs. The main struct is defined as follows... [StructLayout(LayoutKind.Sequential)] public struct ParentStruct { [MarshalAs(UnmanagedType.ByValT...

Objectdeserialization over network

hello, i am getting an excepetion when i try to read an object from an ObjectInputStream via network like this: Socket socket = new Socket("localhost", 4444); ObjectInputStream ois = new ObjectInputStream(socket.getInputStream()); while ((Object o = ois.readObject()) != null) { } Here is the exception I get: java.io.EOFException ...

Possible Solutions to Poor Serialization Performance

I recently did some performance testing and analysis of an ASP.NET application using out-of-process session state - this is necessary when using session state on a web farm so that state can be retrieved on any of the web servers, e.g. if subsequent HTTP requests arrive at a different server because the sessions aren't 'sticky' or the or...

java serialized messages dont contain the correct data in socket-client-server model

hello i have a basic client-server system running using java sockets. my problem is, that an object that i send from the client to the server does not contain the correct data after it has been sent once. the first time i send it, it arrives with the correct values, but when i send it another time with different values, it still arrive...

jQuery plugin to serialize a form and also restore/populate the form?

Hi folks, Is there a jQuery plugin out there that can serialize a form, and then later restore/populate the form given the serialized value? I know the form plugin can serialize as a querystring, but I haven't found anything that will restore the form from the querystring. What I'd like to do is serialize the form values, store as a c...

C# code to serialize plain-old-CLR-objects to JSON

Within an ASP.NET application, I'd like to serialize a collection of plain-old-CLR-objects (POCO) to a JSON string, which will then be sent down to the client as part of a web response. Is there a light-weight C# library that does this? ...

Serialization Exception in C#

Serialization exception occurs when I try to serialize a class in C#, cause it holds a reference to a non serializable class. The problem is that the class I want to serialize is very complicated, and contains a lot of references to other complicated classes, and I can't find the reference to the problematic class in this huge amount of ...

WCF REST service - DataContract stops constructor?

Hi, I have a strange problem that's happening with my WCF REST service. For an operation where it accepts data, let's say it accepts the Foo class: [WebInvoke(Method = "PUT", UriTemplate = "users/{username}")] [OperationContract] public void UpdateLoginUser(string username, LoginUser userUpdated) { [...] } Now my LoginUser class inh...

Stuck on Serialization in C#

I have a class that handles serialization in C#, called Serializer. It's implementation is below: public class Serializer { public void SerializeRulesManager(string filename, RulesManager rulesManager) { Stream stream = File.Open(filename, FileMode.Create); try { BinaryFormatter binar...

Deserializing data sent via TCP

Hi, I have problem with sending objects via TCPClient. At first, I serialize them into byte array and then I send them. TCPListener recieves some data, but deserializer is throwing exception "Unexpected end of stream". Here is reciever code: public void start() { TcpListener listener = new TcpListener(IPAddress.Any, 80...

Problem with serialization to XML using REST and WCF.

Hi guys. I am having problem with using REST and returning response as an XML. I've created basic service from the template and everything looks nice but when I want to serialize my class and return it as a responce the service returns something else. Take a look: [WebHelp(Comment = "Sample description for DoWork")] [WebInvoke(UriTemp...

Tiny serializer

I have a family of classes that contain only variables of the following types: std::string, int, double. I should be able to serialize/deserialize objects of these classes to/from C string (null terminated). I don't want to use some 3rdparty serializer and do not want to write full-featured serializer by myself. I will serialize/deserial...

Dealing with SerializationExceptions in C#

I get a SerializationException: (...) is not marked as serializable. error in the following code: [Serializable] public class Wind { public MyText text; public Size MSize; public Point MLocation; public int MNumber; /.../ } [Serializable] public class MyText { public string MString; public Font MFont; ...

AS3 Date not serializing to Java Date using BlazeDS

When I pass a Actionscript Value Object that contains a Date variable using BlazeDS it is not getting transferring as a java.util.Date object correctly. When the setBaseDatefunction gets called on the Java side the baseDate value is NULL. The weird thing is if I rename the variable on the Java side to private Date date; and create a pu...

copy constructors and base classes C++

Hi, I'd like to be able to initialize a derived class from a base class, like so: class X { public: X() : m(3) {} int m; }; class Y : public X { public: Y() {} Y(const & X a) : X(a) {} }; Is there anything dangerous or unusual by doing that? I want it because I'm deserializing a bunch of objects who's type I don't...

How to get XamlReader.Parse to not throw "property does not exist" XamlParseException?

I'm using XAML for serializing some objects and it's working great for the most part. The problem I'm now facing is when I change the data structure all the old objects produce an exception like the one below. I don't mind if the values are lost. Is there a way to turn off these exceptions and just have the xaml reader ignore unknown ...

Any Tips For Serializing UIComponent

I am trying to serialize an extended UIComponent (com.esri.ags.layers.GraphicsLayer) to send and store in a MSSQL Server database using WebOrb. Apparently, these types of objects aren't meant to be serialized, and I haven't had much serializing/deserializing using the flash byteArray. I have also tried several other libraries(FlexXB,as...

Java's Representation of Serialized Objects

I'm looking for the format that Java uses to serialize objects. The default serialization serializes the object in a binary format. In particular, I'm curious to know if two runs of a program can serialize the same object differently. ...