小编use*_*100的帖子

内容类型application/soap + xml; 服务不支持charset = utf-8

尝试将WCF服务添加到WCFTestClient时,我收到错误以下错误.我在网上经历了一些解决方案,但我无法让它工作.

有人可以帮我解决这些问题吗?我还提供我的服务配置文件:

内容类型application/soap + xml; 服务不支持charset = utf-8客户端和服务绑定可能不匹配.远程服务器返回错误:(415)无法处理消息,因为内容类型为'application/soap + xml; charset = utf-8'不是预期的类型'text/xml; 字符集= utf-8的

码:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>

  <system.web>
    <compilation debug="true" />
  </system.web>
  <!-- When deploying the service library project, the content of the config file 
  must be added to the host's app.config file. System.Configuration does not 
  support config files for libraries. -->
  <system.serviceModel>
    <bindings>
      <basicHttpBinding>
        <binding name="basicHttp" allowCookies="true"
                 maxReceivedMessageSize="20000000"
                 maxBufferSize="20000000"
                 maxBufferPoolSize="20000000">
          <readerQuotas maxDepth="32"
               maxArrayLength="200000000"
               maxStringContentLength="200000000"/>
        </binding>
      </basicHttpBinding>
    </bindings>
    <services>
     <service name="WCFTradeLibrary.TradeService">
        <endpoint address="" binding="basicHttpBinding"
            bindingConfiguration="basicHttp"
            contract="WCFTradeLibrary.ITradeService"> …
Run Code Online (Sandbox Code Playgroud)

wcf

44
推荐指数
4
解决办法
15万
查看次数

标签 统计

wcf ×1