当前位置:编程学习 > C#/ASP.NET >>

提问 问题标签用户 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 --------------------编程问答--------------------
引用 楼主 q403860586 的回复:
ajax调用wcf后返回的结果为list,这个list中又有一个list.ajax里面运行error错。
[WebInvoke(RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
配置没有问题,因为把list=null;就能够正常运行。



是这样的ajax这边
$.ajax({
            type: 'post',
            contentType: 'application/json',
            url: '../Services/OrderService.svc/GetOrders',
            success: function (data) {
//处理
},
error:function(){alert("错误");}

一直运行error。
调试在GetOrders端得到值了的。
补充:.NET技术 ,  Web Services
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,