调用我的Web服务时遇到此异常。我在我的服务中使用EF并尝试返回由EF创建的POCO类。任何想法??
System.Web.Services.Protocols.SoapException:服务器无法执行 处理请求。 ---> System.InvalidOperationException:那里 生成XML文档时出错。 ---> System.InvalidOperationException:类型 System.Data.Entity.DynamicProxies.Job_3C04107CB03F22888B19EF7537A795C816D03441852DC37A42729E7542384BBE 没想到。使用XmlInclude或SoapInclude属性 指定静态未知的类型。在 Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriter1.Write2_Job(字符串 n,String ns,Job o,Boolean isNullable,Boolean needType)at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriter1.Write9_GetJobByNumberResponse(对象[] p)at Microsoft.Xml.Serialization.GeneratedAssembly.ArrayOfObjectSerializer13.Serialize(对象 objectToSerialize,XmlSerializationWriter writer)at System.Xml.Serialization.XmlSerializer.Serialize(XmlWriter xmlWriter, Object o,XmlSerializerNamespaces名称空间,String encodingStyle, String id)---内部异常堆栈跟踪结束--- at System.Xml.Serialization.XmlSerializer.Serialize(XmlWriter xmlWriter, Object o,XmlSerializerNamespaces名称空间,String encodingStyle, 字符串id)at System.Web.Services.Protocols.SoapServerProtocol.WriteReturns(对象[] returnValues,Stream outputStream)at System.Web.Services.Protocols.WebServiceHandler.WriteReturns(对象[] returnValues)at System.Web.Services.Protocols.WebServiceHandler.Invoke()---结尾 内部异常堆栈跟踪---
好的,我发现一篇帖子提到将ProxyCreationEnabled属性设置为false;我做到了这一点,现在它工作正常。什么是将此属性设置为false的效果?