(b) 使用作为工具的网络服务:
[WebMethod(EnableSession = true)]
[ScriptMethod(ResponseFormat = ResponseFormat.Json)]
public List<MyObject> GetList()
{
....return new List of MyObject{ x = .., y = .. , z = ..};
}
使用这一服务的客户用JQuery Ajax电话进行良好工作。
$.ajax({
type: "POST",
url: url,
data: data == null ? "{}" : data,
contentType: "application/json; charset=utf-8",
dataType: "json",
..... and so on ...
但有点火,我注意到答复是:
{"d":[{"__type":"Common.MyObject","z":"2000","x":1500,"y":1000,"a":"0"},{"__type":"Common.MyObject","z":"2000","x":1455,"y":1199.57,"a":"1"}
...... and so on
]}
1) question is why do I need this ""__type":"Common.MyObject" ?
2) I want to remove it so the response will be smaller , how can I do it ?