【发布时间】:2011-11-17 00:37:04
【问题描述】:
我有 WCF 休息服务。我想在 Android 设备上使用它。为此,我选择了 gson 库。在我想从我的服务对象包含地图返回之前,一切似乎都运行良好。 Gson 将其序列化(并且我假设也尝试从中反序列化)如下:
{"org.Mob.ComplexObject@3dac2f9c":"TAX1","org.Mob.ComplexObject@7369ca65":"TAX2"}
但是我的服务发送的json看起来像:
{"Key":
{"DefaultValue":"True",
"Description":null,
"DisplayName":"Custom Boolean",
"FieldType":0,
"Id":6,
"IsReadOnly":false,
"IsRequired":false,
"MaxLength":null,
"Name":"BoolVal",
"ParamType":0},
"Value":"True"},
{"Key":
{"DefaultValue":"",
"Description":null,
"DisplayName":"Custom Text",
"FieldType":4,
"Id":7,
"IsReadOnly":false,
"IsRequired":true,
"MaxLength":16,
"Name":"TextVal",
"ParamType":0},
"Value":"sda"}
}
【问题讨论】: