title: WCF Service failing - HTTP/1.1 400 Bad Request
body: <p>I was getting exception while making a call the my WCF service more larger request XML object content length 65708, where it is working without any issues with request XML file content length less than this.</p>
  
  <p>This is service we are exposed to external clients and I used SoapUI to debug the service and I am getting the exception HTTP/1.1 400 Bad Request[\r][\n] and not even hitting to the debug point. I searched the web and applied the configuration values provided, but none of them helped me to resolve the issue. </p>
  
  <p>After all the config changes, my web.config file is looks like this (only binding part).</p>
  
  <pre><code>    &lt;bindings&gt;
        &lt;basicHttpBinding&gt;
          &lt;binding name="GDASHttp" closeTimeout="00:10:00" openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="2147483647" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" messageEncoding="Mtom" textEncoding="utf-8" transferMode="Streamed" useDefaultWebProxy="true"&gt;
            &lt;readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647"/&gt;
            &lt;security mode="TransportCredentialOnly"&gt;
              &lt;transport clientCredentialType="Windows"/&gt;
            &lt;/security&gt;
          &lt;/binding&gt;
  &lt;/basicHttpBinding&gt;
  </code></pre>
  
  <p>I didn't changed any settings in the client file as I can getting the exception from SoapUI and issue is related to server configuration only. I do understand the issue with some the settings is accepting according to the file size, but not sure what is maximum values we can provide in the above settings.</p>
  
  <p>I modified the IIS settings as per some of the Google advises in  the server and this is my changed applicationhost.config file. </p>
  
  <pre><code>&lt;location path="Default Web Site/GDAS.FY15R2.3.1/Trusted" overrideMode="Allow"&gt;
          &lt;system.webServer&gt;
              &lt;handlers accessPolicy="Read, Execute" /&gt;
              &lt;security&gt;
                  &lt;ipSecurity&gt;
                      &lt;add ipAddress="127.0.0.1" subnetMask="255.255.255.255" allowed="true" /&gt;
                  &lt;/ipSecurity&gt;
                          &lt;requestFiltering&gt; 
                          &lt;requestLimits maxAllowedContentLength="40000000" /&gt; 
                          &lt;/requestFiltering&gt; 
              &lt;/security&gt;
              &lt;serverRuntime uploadReadAheadSize="2147483647" /&gt;
          &lt;/system.webServer&gt;
      &lt;/location&gt;
  </code></pre>