简体   繁体   English

不支持mimetype的WCF服务问题

[英]WCF Service Problem with not supported mimetype

I am constructing a simple WCF service. 我正在构建一个简单的WCF服务。 My web.config is the following: 我的web.config是以下内容:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <system.serviceModel>
<bindings>
    <basicHttpBinding>
        <binding name="MyBasicHttpBinding">
            <security mode="None">
                <transport clientCredentialType="None" />
            </security>
        </binding>
    </basicHttpBinding>
</bindings>
<services>
  <!-- This section is optional with the default configuration
    model introduced in .NET Framework 4 -->
  <service name="WcfService1.Service1" behaviorConfiguration="MyServiceTypeBehaviors">

    <endpoint address="http://companyserver/wcftest/service1.svc"
              binding="basicHttpBinding"
      bindingConfiguration="MyBasicHttpBinding"
              contract="WcfService1.IService1" />

    <endpoint address="mex"
              binding="mexHttpBinding"
              contract="IMetadataExchange" />
  </service>
</services>
<behaviors>
    <serviceBehaviors>
        <behavior name="MyServiceTypeBehaviors" >
            <serviceMetadata httpGetEnabled="true" />
        </behavior>
    </serviceBehaviors>
</behaviors>

  </system.serviceModel>
</configuration>

When I am trying to consume the service it presents the following error message: 当我尝试使用该服务时,它显示以下错误消息:

Content Type application/soap+xml; 内容类型application / soap + xml; charset=utf-8 was not supported by service http://companyserver/wcftest/Service1.svc . 服务http://companyserver/wcftest/Service1.svc不支持charset = utf-8。 The client and service bindings may be mismatched. 客户端和服务绑定可能不匹配。

Check the binding configurations in your client and service. 检查客户端和服务中的绑定配置。 There must be a discrepancy there. 那里一定有差异。 For instance, are you using the same security model on both client and server? 例如,您在客户端和服务器上都使用相同的安全模型吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM