2011-06-20 98 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

檢查客戶端和服務中的綁定配置。那裏肯定有差異。例如,您是否在客戶端和服務器上使用相同的安全模型?