title: Deserializing detail of SOAP message
body: <p>I am working on a Windows Store application.</p>
  
  <p>I have the following manually created Fault class:</p>
  
  <pre><code>[XmlRoot(Namespace = "http://schemas.xmlsoap.org/soap/envelope/", ElementName = "Fault")]
  public partial class SoapFault
  {
      [XmlElement(Form = XmlSchemaForm.Unqualified, ElementName = "faultcode")]
      public String FaultCode { get; set; }
  
      [XmlElement(Form = XmlSchemaForm.Unqualified, ElementName = "faultstring")]
      public String FaultDescription { get; set; }
  
      [XmlElement(Form = XmlSchemaForm.Unqualified, ElementName = "detail")]
      public InnerException[] Detail { get; set; }
  }
  
      [XmlType(Namespace = "http://my.namespace.com", TypeName = "InnerException")]
      public partial class InnerException 
      {
          [XmlElement(Form = XmlSchemaForm.Unqualified, ElementName = "message")]
          public String Message { get; set; }
      }
  </code></pre>
  
  <p>This is the reply of the server i am trying to read:</p>
  
  <pre><code>&lt;env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"&gt;&lt;env:Body&gt;&lt;env:Fault&gt;&lt;faultcode&gt;env:Server&lt;/faultcode&gt;&lt;faultstring&gt;internal error&lt;/faultstring&gt;&lt;detail&gt;&lt;ns2:InnerException xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://ns1.my.namespace.com" xmlns:ns2="http://my.namespace.com" xmlns:ns3="http://ns3.my.namespace.com"&gt;&lt;message&gt;internal error&lt;/message&gt;&lt;/ns2:InnerException &gt;&lt;/detail&gt;&lt;/env:Fault&gt;&lt;/env:Body&gt;&lt;/env:Envelope&gt;
  </code></pre>
  
  <p>The way i am trying to read it is as follows:</p>
  
  <pre><code>using (XmlReader reader = XmlReader.Create(await response.Content.ReadAsStreamAsync()))
  {
      string SoapNamespace = "http://schemas.xmlsoap.org/soap/envelope/";
      try
      {
           var serializer = new XmlSerializer(typeof(SoapFault));
  
           reader.ReadStartElement("Envelope", SoapNamespace);
           reader.ReadStartElement("Body", SoapNamespace);
  
           var fault = serializer.Deserialize(reader) as SoapFault;
  
           reader.ReadEndElement();
           reader.ReadEndElement();
      }
      catch(Exception ex)
      {
           throw new Exception("Exception was thrown:" + ex.Message);
      }
  }
  </code></pre>
  
  <p>I have tried adding namespaces, changing the XmlElement Attributes, but i always end up with the Detail property in the SoapFault being NULL. When i change the type to object, i at least get a XmlNode set which contains the data. </p>
  
  <p>What must i change in this code to get the correct class instantiated on serialization?</p>
  
  <p>Please note: I am unfortunatly forced to create the calls by hand and cannot use auto-generated code. </p>