我有一个wcf网络服务 . 它在我们的iis应用程序服务器上正常运行 . 现在我需要将此应用程序移动到另一台服务器 . 没有改变任何东西,它不适用于新的服务器 . 问题是服务响应类型转为text \ html . 当我在 Headers 选项卡上尝试使用soap ui时:

Content-Type text / html;字符集= UTF-8

当我在一个简单的控制台应用程序中尝试时,我遇到以下错误:

内容类型text / html; charset =响应消息的UTF-8与绑定的内容类型不匹配(text / xml; charset = utf-8)

我究竟做错了什么?

编辑:我刚刚意识到它适用于此绑定设置:

<bindings>
      <basicHttpBinding>
        <binding name="Binding1" hostNameComparisonMode="StrongWildcard" receiveTimeout="00:10:00" sendTimeout="00:10:00" openTimeout="00:10:00" closeTimeout="00:10:00" maxReceivedMessageSize="2147483647" maxBufferPoolSize="52428800" messageEncoding="Text" textEncoding="utf-8" bypassProxyOnLocal="false" useDefaultWebProxy="true">
          <readerQuotas maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxDepth="2147483647" maxNameTableCharCount="2147483647" maxStringContentLength="2147483647" />
          <security mode="TransportWithMessageCredential">
            <message clientCredentialType="UserName"/>
          </security>
        </binding>
      </basicHttpBinding>
    </bindings>

当我将安全模式更改为“无”(我需要)时,内容类型将变为text \ html