Note that there are some explanatory texts on larger screens.

plurals
  1. PONullReferenceException when creating a web reference class
    primarykey
    data
    text
    <p>I have a C# / WPF project that references a webservice. However, sometimes I get a <code>NullReferenceException</code> when creating an instance of the auto-generated class that represents it:</p> <pre><code>var service = new SSO(); </code></pre> <p>The stacktrace is as follows:</p> <pre><code>System.NullReferenceException: Object reference not set to an instance of an object. in System.Xml.Serialization.XmlSerializer.GetSerializersFromCache(XmlMapping[] mappings, Type type) in System.Xml.Serialization.XmlSerializer.FromMappings(XmlMapping[] mappings, Type type) in System.Web.Services.Protocols.SoapClientType..ctor(Type type) in System.Web.Services.Protocols.SoapHttpClientProtocol..ctor() in MyNamespace.SSO..ctor() </code></pre> <p>Does anyone have an idea what's going on here? The server may have small periods of downtime, but that's not the exception I expect to see in case of network connection issues!</p> <p>Update: the code of the auto-generated class <code>SSO</code> in case someone finds it relevant:</p> <pre><code>[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Web.Services", "4.0.30319.17929")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] [System.Web.Services.WebServiceBindingAttribute(Name="SSOSoap", Namespace="http://schemas.example.com/SSO")] public partial class SSO : System.Web.Services.Protocols.SoapHttpClientProtocol { public SSO() { this.Url = "http://example.com/SSO.asmx"; if ((this.IsLocalFileSystemWebService(this.Url) == true)) { this.UseDefaultCredentials = true; this.useDefaultCredentialsSetExplicitly = false; } else { this.useDefaultCredentialsSetExplicitly = true; } } // a lot of methods here } </code></pre>
    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.
    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