2011-06-20 71 views
0

我正在构建一个简单的WCF服务。我的web.config如下:不支持的WCF服务问题mimetype

<?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> 

当我试图使用该服务也提出了以下错误消息:

内容类型application /肥皂+ xml的; charset = utf-8不支持服务http://companyserver/wcftest/Service1.svc。客户端和服务绑定可能不匹配。

+1

您如何使用该服务?例外情况表示您的客户端在SOAP 1.2中发送请求,但您的服务需要SOAP 1.1 –

回答

0

检查客户端和服务中的绑定配置。那里肯定有差异。例如,您是否在客户端和服务器上使用相同的安全模型?