I'd like to return a typedlist from a webmethod call, but it appears to run into a very odd error. Namely it produces a null ref exception with a stack as listed below (top of the trace)
[NullReferenceException: Object reference not set to an instance of an object.]
System.Data.XmlTreeGen.FindTargetNamespace(DataTable table) +268
System.Data.XmlTreeGen.HandleColumn(DataColumn col, XmlDocument dc, XmlElement schema, Boolean fWriteOrdinal) +250
System.Data.XmlTreeGen.HandleTable(DataTable table, XmlDocument dc, XmlElement schema, Boolean genNested) +4334
System.Data.XmlTreeGen.SchemaTree(XmlDocument xd, DataTable dt) +892
System.Data.XmlTreeGen.Save(DataTable dt, XmlWriter xw) +79
System.Data.DataTable.GetSchema() +152
The strange part is that I can get it to excecute just fine if its not used as a web method. The TypedList executes and everything seems to work. This is the only TypedList used in the code, other web methods return entities and entity collections. They all work.
Has anyone come across this sort of thing before?
Thanks.