加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

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

发布时间:2020-12-16 08:06:09 所属栏目:百科 来源:网络整理
导读:嗨 我试图添加WCF服务WCFTestClient时收到错误以下错误。我经过网上的解决方案的数量,但不能得到它的工作 有人可以帮助我的问题吗? 我也prviding我的配置文件的服务 Content Type application/soap+xml; charset=utf-8 was not supported by service The c

我试图添加WCF服务WCFTestClient时收到错误以下错误。我经过网上的解决方案的数量,但不能得到它的工作
有人可以帮助我的问题吗?
我也prviding我的配置文件的服务

Content Type application/soap+xml; charset=utf-8 was not supported by
service The client and service bindings may be mismatched. The
remote server returned an error: (415) Cannot process the message
because the content type ‘application/soap+xml; charset=utf-8’ was not
the expected type ‘text/xml; charset=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">          
         </endpoint>
     </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior>
          <!-- To avoid disclosing metadata information,set the value below to false and remove the metadata endpoint 
          above before deployment -->
          <serviceMetadata httpGetEnabled="true"/>
          <!-- To receive exception details in faul`enter code here`ts for 
          debugging purposes,set the value below to true.  Set to false before deployment 
          to avoid disclosing exception info`enter code here`rmation -->
          <serviceDebug includeExceptionDetailInFaults="true" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>

</configuration>
这里是一个web.config的例子解决我的问题。注意< binding name =“TransportSecurity”messageEncoding =“Text”textEncoding =“utf-8”>

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读