Questions tagged [deserialization]

Deserialization is the process by which an object is recreated from its serialized state.

7954 questions
3
votes
1 answer

JSON Deserialization Despair (unable to deserialize nested types)

There are probably 500 questions like this on SO, and a million websites out there all offering tidbits of information - but I just can't see the wood for the trees. This seems like it should be embarrassingly simple to do, but I just can't make it…
Eight-Bit Guru
  • 9,756
  • 2
  • 48
  • 62
3
votes
2 answers

Python, yaml nested objects

I am trying to create a yaml format that allow me to create an object inside another object. In this sample i am trying to create a State Machine object and at the same time populate it with some states and connections between…
jpereira
  • 251
  • 2
  • 11
3
votes
1 answer

Deserialize XML to same type childs on different elements

UPDATE: SOLVED - See below! When deserializing a xml file containing network nodes there seem to go something wrong when handling child elements. I've got the following parent (root) class: NetworkCollection [Serializable, XmlRoot("networks"),…
3
votes
3 answers

how to extract faultcode from a WCF message in AfterReceiveReply

This is what I ideally want to do public void AfterReceiveReply(ref Message reply, object correlationState) { if (reply.IsFault) { FaultException exp = reply.GetBody(); if…
Rwiti
  • 1,056
  • 1
  • 13
  • 31
3
votes
1 answer

C# deserialization element mapping

I would like to deserialize the following XML into the following type. How do I map the status correctly? (it is currently not mapped and remains null after the deserialization process)
Ben Aston
  • 53,718
  • 65
  • 205
  • 331
3
votes
5 answers

Can't seem to deserialize very simple xml using XmlSerializer in c#

I feel like I am going made. I have written a hundred deserializing routines, but this one is killing me! Below is what I get returned from a service. A very simple array of strings...I think.
NER1808
  • 1,829
  • 2
  • 33
  • 45
3
votes
1 answer

Different JSON array response

I have problems parsing two different JSON responses. 1: This is the JSON response I get from a RESTful API: { "gear": [ { "idGear": "1", "name": "Nosilec za kolesa", "year": "2005", "price": "777.0" }, { …
Mitja Rogl
  • 894
  • 9
  • 22
  • 39
3
votes
3 answers

serialize object for unit testing

Assuming in a unit test I need to have an object all of 50 fields of which are set up with some values. I don't want to manually set up all this fields, as it takes time and annoying... Somehow I need to get an instance where all the fields are…
javagirl
  • 1,635
  • 6
  • 27
  • 43
3
votes
1 answer

Deserialize JSON into a generic map, forcing all JSON floats into Decimal or String, in Jackson

I am using Jackson in the jsonrpc4j to access a remote service. In my Java application there are no defined classes for the return values, so deserialization produces generic LinkedHashMaps. So I cannot put any annotations anywhere. jsonrpc4j can…
Cray
  • 2,396
  • 19
  • 29
3
votes
3 answers

Spring's DI not transient and not serializable but Logs NSE

I have a Session-Scope Bean LoginPlaintext that must not be serializable. I have a Session-Scope Bean LoginMD5Salted that must be serializable. Both share the interface Login that is not Serializable (because LoginPlaintext must be not…
Grim
  • 1,938
  • 10
  • 56
  • 123
3
votes
1 answer

Type Information within serialized JSON using GSON

Using Jackson we have the option to attach the type info to the serialized object (http://jackson.codehaus.org/1.5.5/javadoc/org/codehaus/jackson/annotate/JsonTypeInfo.html). Is there a way to do this using GSON like: { propertyName:"test", …
Francisco Spaeth
  • 23,493
  • 7
  • 67
  • 106
3
votes
1 answer

@JsonUnwrapped disables Jackson's fail_on_unknown properties

I'm attempting to write a simple class that will validate a JSON input string if it can be converted to a target JAVA object. The validator should fail if any unknown field is found in the input JSON String. It all works as expected except until I…
ufasoli
  • 1,038
  • 2
  • 19
  • 41
3
votes
3 answers

Resttemplate unable to parse array of type T

I'm facing a problem with Spring and restTemplate. I want to send an object (ListResponse) that contains a generic array. The defenition is as follow: public class ListResponse implements Serializable { private long total; private int…
Tom
  • 613
  • 2
  • 6
  • 9
3
votes
1 answer

deserealize into a generic sortedlist C#

I want to deserialize in a generic SortedList, just like this example with the hashtable http://msdn.microsoft.com/es-es/library/system.runtime.serialization.formatters.binary.binaryformatter(v=vs.80).aspx But in this line collectionContacts =…
Priscila
  • 301
  • 4
  • 19
3
votes
1 answer

How do you serialize a guava collection?

I must be missing something obvious but I can't manage to serialize a TreeBasedTable. It is marked as @GwtCompatible(serializable = true), so my understanding is that I need to use the guava-gwt library to (de-)serialize it. But I can't find do…
assylias
  • 321,522
  • 82
  • 660
  • 783