Note that there are some explanatory texts on larger screens.

plurals
  1. POXmlInclude or SoapInclude
    primarykey
    data
    text
    <p>I am developing a webservice that returns arrays of classes I define within the webservice. When I test it, I get: "System.InvalidOperationException: The type WebSite+HostHeader was not expected. Use the XmlInclude or SoapInclude attribute to specify types that are not known statically."</p> <p>Here is part of the code:</p> <pre class="lang-cs prettyprint-override"><code>[WebService(Namespace = "http://WebSiteInfo.Podiumcrm.com/")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] public class WebSite : System.Web.Services.WebService { public class WebSiteEntry { public string SiteName = ""; public string Comment = ""; public string IISPath = ""; public int SiteID = 0; public ArrayList HostHeaders; public WebSiteEntry() { } } public class HostHeader { public string IPAddress = ""; public int Port = 0; public string URL = ""; public HostHeader() { } } [WebMethod(EnableSession = true)] [TraceExtension(Filename = @"C:\DotNetLogs\WebSiteServices.log")] public WebSiteEntry[] WebSites() {...} } </code></pre> <p>When I try: </p> <pre class="lang-cs prettyprint-override"><code>[WebService(Namespace = "http://WebSiteInfo.Podiumcrm.com/")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] [XmlInclude(typeof(WebSiteEntry))] [XmlInclude(typeof(WebSiteProperty))] [XmlInclude(typeof(HostHeader))] public class WebSite : System.Web.Services.WebService {...} </code></pre> <p>I get: "The type or namespace name XmlInclude could not be found (are you missing a using directive or an assembly reference?)"</p> <p>Points the the person who can give me the incantation that both compiles and executes!</p> <p>Thanks...</p>
    singulars
    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.
    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