title: WCF service binding content type mismatch - text/xml and application/soap+xml
body: <p>I have been at this for a few days trying to figure out why I am getting a content type mismatch error in my binding.  There are countless other people that seem to be having this issue but all the resolutions don't apply or haven't worked.</p>
  
  <p>I have looked everywhere trying to figure out why I am getting the following error:</p>
  
  <h2>Server Error in '/' Application.</h2>
  
  <p>The content type application/soap+xml; charset=utf-8 of the response message does not match the content type of the binding (text/xml; charset=utf-8). If using a custom encoder, be sure that the IsContentTypeSupported method is implemented properly. The first 823 bytes of the response were: </p>
  
  <p><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;&lt;soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt;&lt;soapenv:Body&gt;&lt;GetQuoteResponse xmlns="http://soap.service.GMO.com"&gt;&lt;Quote_Response&gt;&lt;errorMessage&gt;&lt;/errorMessage&gt;&lt;return_List&gt;&lt;item&gt;&lt;errorMessage&gt;&lt;/errorMessage&gt;&lt;monthlyPremiumAmount&gt;6.0&lt;/monthlyPremiumAmount&gt;&lt;webID&gt;7P3W4Txst&lt;/webID&gt;&lt;basePer1&gt;1000.0&lt;/basePer1&gt;&lt;basePer2&gt;0.0&lt;/basePer2&gt;&lt;baseRate1&gt;0.05&lt;/baseRate1&gt;&lt;baseRate2&gt;0.0&lt;/baseRate2&gt;&lt;benefitID&gt;5365&lt;/benefitID&gt;&lt;coverageAmount&gt;100000&lt;/coverageAmount&gt;&lt;grossPer1&gt;1000.0&lt;/grossPer1&gt;&lt;grossPer2&gt;0.0&lt;/grossPer2&gt;&lt;grossRate1&gt;0.06&lt;/grossRate1&gt;&lt;grossRate2&gt;0.0&lt;/grossRate2&gt;&lt;/item&gt;&lt;/return_List&gt;&lt;/Quote_Response&gt;&lt;/GetQuoteResponse&gt;&lt;/soapenv:Body&gt;&lt;/soapenv:Envelope&gt;</code>. </p>
  
  <p>The web service I am consuming is not hosted in IIS.  The web service itself seems to be working properly because we use SoapUI and get all the proper results returned to us.  As you can also see from the above error message, values are being returned from the web service.</p>
  
  <p>I have also been using Fiddler and am able to confirm that the request header content type is text/xml and the response header content type is application/soap+xml.</p>
  
  <p>We have a datalayer where the service reference resides.  The app.config looks like this:</p>
  
  <pre><code>&lt;system.serviceModel&gt;
      &lt;bindings&gt;
          &lt;basicHttpBinding&gt;
              &lt;binding name="IMSQuoteServiceBinding" closeTimeout="00:01:00"
                  openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
                  allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
                  maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
                  messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" 
                  useDefaultWebProxy="true"&gt;
                  &lt;readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
                      maxBytesPerRead="4096" maxNameTableCharCount="16384" /&gt;
                  &lt;security mode="None"&gt;
                      &lt;transport clientCredentialType="None" proxyCredentialType="None"
                          realm="" /&gt;
                      &lt;message clientCredentialType="UserName" algorithmSuite="Default"  /&gt;
                  &lt;/security&gt;
  
              &lt;/binding&gt;
  
          &lt;/basicHttpBinding&gt;
      &lt;/bindings&gt;
      &lt;client&gt;
          &lt;endpoint address="http://hostingServerName:81/cgi-bin/jsmdirect?IMSQuote"
              binding="basicHttpBinding" bindingConfiguration="IMSQuoteServiceBinding"
              contract="Quote.IMSQuoteServicePortType" name="IMSQuoteServicePort" /&gt;
      &lt;/client&gt;
  &lt;/system.serviceModel&gt;
  </code></pre>
  
  <p>The web site web.config looks like this:</p>
  
  <pre><code>&lt;system.serviceModel&gt;
  &lt;bindings&gt;
    &lt;basicHttpBinding&gt;
      &lt;binding name="IMSQuoteServiceBinding" closeTimeout="00:01:00"
          openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
          allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
          maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
          messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
          useDefaultWebProxy="true"&gt;
        &lt;readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
            maxBytesPerRead="4096" maxNameTableCharCount="16384" /&gt;
        &lt;security mode="None"&gt;
          &lt;transport clientCredentialType="None" proxyCredentialType="None"
              realm="" /&gt;
          &lt;message clientCredentialType="UserName" algorithmSuite="Default" /&gt;
        &lt;/security&gt;
  
      &lt;/binding&gt;
    &lt;/basicHttpBinding&gt;    
  
  &lt;/bindings&gt;
  &lt;client&gt;
    &lt;endpoint address="http://hostingServerName:81/cgi-bin/jsmdirect?IMSQuote"
        binding="basicHttpBinding" bindingConfiguration="IMSQuoteServiceBinding"
        contract="Quote.IMSQuoteServicePortType" name="IMSQuoteServicePort" /&gt;
  &lt;/client&gt;
  </code></pre>
  
  <p></p>
  
  <p>Any help would be very much appreciated.  I am somewhat new to WCF and am open to any and all ideas.</p>
  
  <p>Thank you all in advance for your help.  If you need me to provide any more information, please let me know.</p>