webservice asmx 无法序列化接口 System.Collections.Generic.IList
2015-05-18 18:50
549 查看
转载自:/article/6056260.html
今天有位同事在方法里加了一个IList<entity> 的返回值,也没有测试,直接发布,导致了如下错误。
最终查下来,web service 不支持这样的类型返回IList<entity> ,故将其改成 List<entity> 编译正常返回。
今天有位同事在方法里加了一个IList<entity> 的返回值,也没有测试,直接发布,导致了如下错误。
NotSupportedException: 无法序列化接口 System.Collections.Generic.IList InvalidOperationException: 反射“entity”时出错。 InvalidOperationException: 无法反射方法 method name InvalidOperationException: 无法处理请求。 InvalidOperationException: 处理请求失败。
最终查下来,web service 不支持这样的类型返回IList<entity> ,故将其改成 List<entity> 编译正常返回。
相关文章推荐
- webservice asmx 无法序列化接口 System.Collections.Generic.IList
- MVC 无法将类型“System.Collections.Generic.List<AnonymousType#1>”隐式转换为“System.Collections.Generic.IList<Mvc3Modeltest.Models.Movie>”。存在一个显式转换(是否缺少强制转换?))
- The model item passed into the dictionary is of type 'System.Collections.Generic.List`1[BMS.DataAccess.Models.ServiceTyp
- 无法将类型“System.Collections.Generic.IEnumerable<EmailSystem.Model.TemplateInfo>”隐式转换为“System.Collections.Generic.List<EmailSystem.Model.TemplateInf
- NHibernate无法将类型“System.Collections.Generic.IList<T>”隐式转换为“System.Collections.Generic.IList<IT>
- CS1612: 无法修改“¡°System.Collections.Generic.List.this[int]””的返回值,因为它不是变量。【C# 语言中 struct 的陷阱】
- 无法将类型“System.Collections.Generic.List<anonymous type:string ClassID,string ClsssName>”隐式转换为“System.Collections.Generic.List<Ecology.Model.EnergyFlowGraph>”
- System.Collections.Generic.IEnumerable<T>接口
- System.Collections.Generic.List<T> 与 System.Collections.ArrayList
- 发布webservice接口时报错-HTTP Status 500 - File "/axis2-web/listSingleService.jsp" not found
- 无法将类型为“System.Security.Principal.GenericIdentity”的对象强制转换为类型“System.Web.Security.FormsIdentity”的错误
- System.Collections.Generic 命名空间接口、结构
- VS2005的System.Collections.Generic.List的一些查找方法的不足
- System.Collections.Generic.List<>是System.Collections.ArrayList的泛型实现
- “System.Collections.Generic.IEnumerable<TestDAL.HistoryData>”不包含“ToList”的定义
- “System.Collections.Generic.IEnumerable<TestDAL.HistoryData>”不包含“ToList”的定义
- 无法将类型为“System.__ComObject”的 COM 对象强制转换为接口类型“Microsoft.VisualStudio.Tools.Applications.Runtime.IHostServiceProvider”
- 无法将类型为“System.__ComObject”的 COM 对象强制转换为接口类型“Microsoft.VisualStudio.OLE.Interop.IServiceProvider”。
- System.Collections.Generic.LinkedList 学习笔记
- IList Webservice 序列化