I have a web service method that returns an XMLDocument. The signature is:
public XmlDocument GetPOs()
The following client code calls this method but it accepts an XMLNode
instead of an XMLDocument and my first question is why does this work?
XmlNode neNode;
neNode = myHFCService.GetPOs();
DataSet myds = new DataSet();
byte[] buf =
System.Text.ASCIIEncoding.ASCII.GetBytes(neNode.Ou terXml);
System.IO.MemoryStream ms = new System.IO.MemoryStream(buf);
myds.ReadXml(ms);
gvOrders.DataSource = myds.Tables[0];
Secondly, why does the following client code get a type mismatch?
XmlDocument myXMLDoc = new XmlDocument();
myXMLDoc = myHFCService.GetPOs();
The service is returning a type of XMLDocument but it comes back as XMLNode.
Those are different types.
Thanks,
Gary