Hi Diego,
Yeah ServiceStack accepts nested JSON no problem.
In times when you're having interoperability problems I suggest that you have Fiddler open (which is very easy to use) so you can see exactly what's going on. Also the Fiddler packet trace is more valuable in diagnosing problems since it holds the 'empirical truth' of what's happening on the wire even more than the source code since as can be seen in this example, where the source code does something different than what you're expecting.
The problem with your service is that jQuery by default sends your data via key value pairs (i.e. application/x-www-form-urlencoded) so you need to serialize it to JSON yourself if you want jQuery to send JSON instead of key value pairs.
I've modified your POST example to send JSON data:
$.post("geoinfo", JSON.stringify(jdata),
function (data) {
alert(data.Result);
},
"json");
This is the longer form of how you can POST json data using jQuery which lets you toggle different parts of the ajax request:
$.ajax({
url: "geoinfo",
type: "POST",
contentType: "application/json",
accept: "application/json",
dataType: "json",
data: JSON.stringify(jdata),
success: function (data) {
alert(data.Result);
}
});
It seems that you have some DTO's are decorated with [DataContract] and some not. Note: [DataContract] is optional, and it just allows you to control some of the XML serialized output (or should you wish control which properties are serialized). Also [Serializable] doesn't mean anything in ServiceStack, the only library which requires it is the memcached ICacheClient since it uses the Binary Formatter internally, so if you aren't using/needing it I think you should consider dropping it.
Hope this helps.
Regards,