title: How to handle incorrect SOAP fault in WCF?
body: <p>I have to consume to a third-party web service using SOAP. It was easy to get it to work with WCF, but now I have a problem with SOAP faults. The service sends me an incorrect SOAP fault:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt;
  &lt;SOAP-ENV:Envelope 
      SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" 
      xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"&gt;
      &lt;SOAP-ENV:Body&gt;
          &lt;SOAP-ENV:Fault&gt;
              &lt;SOAP-ENV:faultcode&gt;14&lt;/SOAP-ENV:faultcode&gt;
              &lt;SOAP-ENV:faultstring&gt;Unknown Function&lt;/SOAP-ENV:faultstring&gt;
          &lt;/SOAP-ENV:Fault&gt;
      &lt;/SOAP-ENV:Body&gt;
  &lt;/SOAP-ENV:Envelope&gt;
  </code></pre>
  
  <p>The error is that the <code>&lt;faultcode&gt;</code> must not have a namespace:</p>
  
  <pre><code>System.ServiceModel.CommunicationException : Server returned an invalid 
  SOAP Fault. Please see InnerException for more details.
      ----&gt; System.Xml.XmlException : Start element 'faultcode' from namespace 
      '' expected. Found element 'SOAP-ENV:faultcode' from namespace 
      'http://schemas.xmlsoap.org/soap/envelope/'.
  </code></pre>
  
  <p>I can't change the original web service - but is there anything in WCF I can use to still handle these fault messages in some way without getting <code>CommunicationException</code> all the time?</p>