title: Why does WCF return code 400 when content-type:application/xml header is present?
body: <p>I have a REST WCF service that is returning a Bad Request (400) response when the content-type:application/xml header is included in the request.  When I remove that header, the service responds correctly.</p>
  
  <p>Service definition:</p>
  
  <pre><code>[ServiceContract]
  public interface IRestService
  {
      [OperationContract]
      [WebInvoke(UriTemplate = "/methodName", BodyStyle=WebMessageBodyStyle.Bare)]
      XElement MethodName(Stream stream);
  }
  </code></pre>
  
  <p>Endpoint configuration:</p>
  
  <pre><code>  &lt;system.serviceModel&gt;
      &lt;behaviors&gt;
        &lt;endpointBehaviors&gt;
          &lt;behavior name="webHttp"&gt;
            &lt;webHttp/&gt;
          &lt;/behavior&gt;
        &lt;/endpointBehaviors&gt;
      &lt;/behaviors&gt;
      &lt;bindings&gt;
        &lt;webHttpBinding&gt;
          &lt;binding maxReceivedMessageSize="1024000"/&gt;
        &lt;/webHttpBinding&gt;
      &lt;/bindings&gt;
      &lt;services&gt;
        &lt;service name="RestService"&gt;
          &lt;endpoint address="" behaviorConfiguration="webHttp" binding="webHttpBinding"
            name="webHttpBinding" contract="IRestService" /&gt;
        &lt;/service&gt;
      &lt;/services&gt;
    &lt;/system.serviceModel&gt;
  </code></pre>
  
  <p>The payload is valid XML.</p>