Is it possible to return an XElement from a webservice (in C#/asp.net)?
Try a simple web service that returns an XElement:
[WebMethod]
public XElement DoItXElement()
{
XElement xe = new XElement("hello",
new XElement("message", "Hello World")
);
return xe;
}
This compiles fine but if you try and run it you get
Cannot use wildcards at the top level of a schema.
I found this post implying that this is a bug in .net.
So... Can I return an XElement from a web service? If so, how?
Thanks.