I have a web service 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 a web service, 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 checked double and the object I have to return is not empty.
I assume ASP.Net cannot properly serialize my class (due to IEnumerable?). I was going to use Xml Serialization and my service returns an XmlDocument, but I don't think this is the best way.
What is the easiest way to pass this object (with minimal work)?
source share