2014-10-01 59 views
0

我得到這個錯誤,當我試圖調用從sharpoint我的自定義SVC文件。我已經在這裏發佈了我的web.config文件,你能告訴Wats錯誤嗎?HTTP WCF錯誤「無法找到匹配方案HTTPS與結合MetadataExchangeHttpsBinding端點的基址......」

想有在SharePoint我的自定義Web服務,所以我創建了一個項目,但由於這個錯誤,我不能瀏覽我的網站的方法。

<?xml version="1.0"?> 
<configuration> 
    <system.serviceModel> 
    <services> 
     <service behaviorConfiguration="AlertWcfService.CustomServiceBehaviour" 
     name="AlertWcfService.AlertService"> 
     <endpoint address="http://localhost:2000/" binding="basicHttpBinding" bindingConfiguration="basicHttpBindingConfiguration" 
        contract="AlertWcfService.IAlertService" > 
      <identity> 
      <dns value="localhost" /> 
      </identity> 
     </endpoint> 
     <endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" /> 
     <host> 
      <baseAddresses> 
      <add baseAddress="http://localhost:2000/"></add> 
      </baseAddresses> 
     </host> 
     </service> 
    </services> 
    <bindings> 
     <basicHttpBinding> 
     <binding name="basicHttpBindingConfiguration"> 
      <security mode="Transport"> 
      <transport clientCredentialType="None" proxyCredentialType="None" realm=""/> 
      <message clientCredentialType="Certificate" algorithmSuite="Default" /> 
      </security> 
     </binding> 
     </basicHttpBinding> 
    </bindings> 
    <behaviors> 
     <serviceBehaviors> 
     <behavior name="AlertWcfService.CustomServiceBehaviour"> 
      <!--<serviceMetadata httpsGetEnabled="false"/>--> 
      <serviceMetadata httpGetEnabled="false" httpsGetEnabled="false"/> 
      <serviceDebug includeExceptionDetailInFaults="false"/> 
     </behavior> 
     </serviceBehaviors> 
    </behaviors> 
    </system.serviceModel> 
</configuration> 

回答

2

錯誤在於您沒有使用HTTPS,但您使用的是HTTPS而不是HTTP的MEX綁定。爲了解決這個問題,改變這一行:

<endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" /> 

<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /> 
0

在您的接口聲明IAlertService,添加命名空間旁邊的name屬性,如果你沒有它尚未...

[ServiceContract(Name = "NameNeeded", Namespace = "http://blahbalh")] 
    public interface IAlertService 
{ 
..... 
} 
相關問題