title: ISO-8859-1 character set in WCF Request
body: <p>I have written a REST WCF service that is called by an external API. The request is sending the XML POST request in ISO-8859-1. This results in a 400 bad request response from my service.</p>
  
  <p>Here's a stub of my service method:</p>
  
  <pre><code> [OperationContract]
   [WebInvoke(Method ="POST", UriTemplate="/", RequestFormat = WebMessageFormat.Xml, BodyStyle = WebMessageBodyStyle.Bare)]
   [FaultContract(typeof(String))]
   XmlElement GetInstructions(XmlElement request);
  </code></pre>
  
  <p>Currently, I'm trying to intercept the request and return the appropriate content type:</p>
  
  <pre><code>public class XmlContentTypeMapper : WebContentTypeMapper
  {
      public override WebContentFormat GetMessageFormatForContentType(string contentType)
      {
          return WebContentFormat.Xml;
      }
  }
  </code></pre>
  
  <p>This only works if I remove the charset=ISO-8859-1 from the headers.   </p>
  
  <p>I've seen examples of using IClientMessageInspector and IDispatchMessageInspector, but those seem specific to SOAP, unless I'm missing something.</p>
  
  <p>What can I do to fix this?  I don't have any control over the incoming request.  </p>
  
  <p>Thanks for any insight.</p>
  
  <p>Here's the first part of the XML request:</p>
  
  <pre><code>POST http://localhost:54814/autocallerid.svc HTTP/1.1
  Host: localhost:54814
  Content-Type: text/xml, charset=ISO-8859-1
  Content-Length: 1734
  
  &lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;Request xmlns="urn:oasis:names:tc:xacml:2.0:context:schema:os"&gt;
      &lt;Subject SubjectCategory="urn:oasis:names:tc:xacml:1.0:subject-category:access-subject"&gt;
   .... 
  </code></pre>