Note that there are some explanatory texts on larger screens.

plurals
  1. POWebservice method return XmlDocument, Reference sees a XmlNode
    primarykey
    data
    text
    <p>I've faced a problem I can't solve that's why I beg you to help me! I'm working with a WebService and I'm trying to return a XmlDocument from a WebService method called GetSystemDocument which looks like : </p> <pre><code>[WebMethod(Description = "blabla")] public XmlDocument GetSystemDocument(string DocumentName) { return new XmlDocument(); } </code></pre> <p>In the project where I reference this web service. Visual Studio tells me it cannot implicitily convert type 'System.Xml.XmlNode' to 'System.Xml.XmlDocument'.</p> <p>If I look into the Reference.cs file(generated by Visual Studio) the code looks like :</p> <pre><code>/// &lt;remarks/&gt; [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://doc.cexp.ca/GetSystemDocument", RequestNamespace="http://doc.cexp.ca", ResponseNamespace="http://doc.cexp.ca", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] public System.Xml.XmlNode GetSystemDocument(string DocumentName) { object[] results = this.Invoke("GetSystemDocument", new object[] { DocumentName}); return ((System.Xml.XmlNode)(results[0])); } </code></pre> <p>The problem is there. Instead of XmlNode we should see XmlDocument, If I edit it manually, It builds and everything works fine.</p> <p>I've tried resetting IIS, update the reference, rebuild the web service. Someone has a solution?</p> <p>Here is a <a href="http://www.dreamincode.net/forums/topic/41627-wacky-webservice-problem/" rel="nofollow">Similar question</a> which is unanswered.</p> <p>Thanks a lot</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload