Hello,
I have a webservice that returns a complex value (this is a tree)
public class DocumentTreeNode
{
public MyDocument Data
{ get; set;}
private LinkedList<DocumentTreeNode> _children;
public IEnumerable<DocumentTreeNode> Children
{
get
{
return _children.AsEnumerable();
}
}
(...)
}
Unfortunately, when I call the webservice, it returns
<?xml version="1.0" encoding="utf-8"?>
<DocumentTreeNode xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://tempuri.org/" />
I have double checked, and the object I am supposed to return is not empty.
I'm guessing that means ASP.Net is unable to properly serialize my class (due to the IEnumerable?). I was going to use an Xml Serialization and have my service return an XmlDocument, but I don't think this is the best way.
What is the easiest way to pass this object through (with minimal work) ?