提问 问题标签用户 ajax调用wcf后返回的结果.ajax里面运行error错。
ajax调用wcf后返回的结果为list,这个list中又有一个list.ajax里面运行error错。[WebInvoke(RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
配置没有问题,因为把list=null;就能够正常运行。 ajax wcf 调用 json --------------------编程问答-------------------- List<T> 的类型需要用 KnowType 告诉WCF --------------------编程问答--------------------
是这样的ajax这边
$.ajax({
type: 'post',
contentType: 'application/json',
url: '../Services/OrderService.svc/GetOrders',
success: function (data) {
//处理
},
error:function(){alert("错误");}
一直运行error。
调试在GetOrders端得到值了的。
补充:.NET技术 , Web Services