2017-08-29 78 views
0

有關於此錯誤的幾個其他問題(對於大多數相對地址 - 這是不是我要找的,因爲我們使用相對地址的arent)WCF:沒有協議綁定匹配給定的地址

我們有(使用

No protocol binding matches the given address ' https://domain.local/programmeservice.svc '. Protocol bindings are configured at the Site level in IIS or WAS configuration.

我們可以訪問的網站的細根的https:但在一個封閉的網絡上最新的安裝(使用HTTPS),我們收到的錯誤 - 這是幾個環境部署沒有問題WCF服務),所以我們非常確定這是我們綁定的配置問題 - 但我們沒有想法。

該服務的web.config配置如下:

<system.serviceModel> 
    <bindings> 
     <basicHttpBinding> 
     <binding name="Service.BasicHttp.BindingConfig"> 
      <security mode="Transport"> 
      <transport clientCredentialType="Windows" /> 
      </security> 
     </binding> 
     </basicHttpBinding> 
    </bindings> 
    <services> 
     <service name="SomeTestService" behaviorConfiguration="SomeTestService"> 
     <endpoint address="https://domain.local:443/testservice.svc" binding="basicHttpBinding" bindingConfiguration="Service.BasicHttp.BindingConfig" contract="ISomeTestService" /> 
     <endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" /> 
     </service> 
    </services> 
     <behaviors> 
      <serviceBehaviors> 
       <behavior name="SomeTestService"> 
        <serviceMetadata httpsGetEnabled="true" /> 
        <serviceDebug includeExceptionDetailInFaults="true" /> 
        <dataContractSerializer maxItemsInObjectGraph="2147483647" /> 
       </behavior> 
     </serviceBehaviors> 
     </behaviors> 
     <serviceHostingEnvironment aspNetCompatibilityEnabled="true" /> 
    </system.serviceModel> 

錯誤的完整堆棧跟蹤是:

[InvalidOperationException: No protocol binding matches the given address ' https://domain.local/programmeservice.svc '. Protocol bindings are configured at the Site level in IIS or WAS configuration.]
System.ServiceModel.Activation.HostedAspNetEnvironment.GetBaseUri(String transportScheme, Uri listenUri) +154751
System.ServiceModel.Channels.TransportChannelListener.OnOpening() +16284708 System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) +255
System.ServiceModel.Dispatcher.ChannelDispatcher.OnOpen(TimeSpan timeout) +72

[InvalidOperationException: The ChannelDispatcher at ' https://domain.local/programmeservice.svc ' with contract(s) '"ProgrammeService"' is unable to open its IChannelListener.]
System.ServiceModel.Dispatcher.ChannelDispatcher.OnOpen(TimeSpan timeout) +145
System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) +301 System.ServiceModel.ServiceHostBase.OnOpen(TimeSpan timeout) +130
System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) +301
System.ServiceModel.HostingManager.ActivateService(ServiceActivationInfo serviceActivationInfo, EventTraceActivity eventTraceActivity) +129
System.ServiceModel.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath, EventTraceActivity eventTraceActivity) +741

[ServiceActivationException: The service '/programmeservice.svc' cannot be activated due to an exception during compilation. The exception message is: The ChannelDispatcher at ' https://domain.local/programmeservice.svc ' with contract(s) '"ProgrammeService"' is unable to open its IChannelListener..]
System.Runtime.AsyncResult.End(IAsyncResult result) +607194
System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result) +231
System.Web.CallHandlerExecutionStep.OnAsyncHandlerCompletion(IAsyncResult ar) +177

+0

你的網站在IIS管理器中有一個https綁定嗎? – Fai

+0

是的,https綁定使用IIS中的有效證書進行設置,並且對於根站點工作正常。 – Steveland83

+0

另一個線程說端點地址應該是相對地址而不是絕對地址? – Fai

回答

0

萬一這證明別人有用的 - 這是我們的構建腳本的一個問題,它們在其中創建了帶有額外字符的端點地址,這顯然不符合綁定... 就像錯誤信息告訴我們整個時間

如果您看到類似的錯誤,請三重檢查提供的服務端點地址真的與您在IIS中設置的內容是否相符。