簡體   English   中英

WCF:沒有協議綁定與給定地址匹配

[英]WCF: No protocol binding matches the given address

還有與此錯誤相關的其他幾個問題(大多數與相對地址有關-這些不是我在尋找相對地址時要查找的內容)

我們提供了WCF服務,該服務可以在多個環境中正常部署-但是在封閉網絡(使用https)上的最新安裝中,我們會收到以下錯誤消息:

沒有協議綁定與給定地址“ https://domain.local/programmeservice.svc ”匹配。 協議綁定是在IIS或WAS配置的站點級別配置的。

我們可以很好地訪問站點的根目錄(使用https),因此我們可以確定這是我們綁定的配置問題-但我們沒有主意。

該服務的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:沒有協議綁定匹配給定地址' https://domain.local/programmeservice.svc '。 協議綁定是在IIS或WAS配置的站點級別配置的。]
System.ServiceModel.Activation.HostedAspNetEnvironment.GetBaseUri(字符串transportScheme,Uri listenUri)+154751
System.ServiceModel.Channels.TransportChannelListener.OnOpening()+16284708 System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan超時)+255
System.ServiceModel.Dispatcher.ChannelDispatcher.OnOpen(TimeSpan超時)+72

[InvalidOperationException:帶有合同'“ ProgrammeService”'的位於https://domain.local/programmeservice.svc的ChannelDispatcher無法打開其IChannelListener。
System.ServiceModel.Dispatcher.ChannelDispatcher.OnOpen(TimeSpan超時)+145
System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan超時)+301 System.ServiceModel.ServiceHostBase.OnOpen(TimeSpan超時)+130
System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan超時)+301
System.ServiceModel.HostingManager.ActivateService(ServiceActivationInfo serviceActivationInfo,EventTraceActivity eventTraceActivity)+129
System.ServiceModel.HostingManager.EnsureServiceAvailable(字符串normalizedVirtualPath,EventTraceActivity eventTraceActivity)+741

[ServiceActivationException:由於編譯期間發生異常,因此無法激活服務'/programmeservice.svc'。 異常消息是:帶有合同“ ProgrammeService”的“ https://domain.local/programmeservice.svc ”處的ChannelDispatcher無法打開其IChannelListener。
System.Runtime.AsyncResult.End(IAsyncResult結果)+607194
System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult結果)+231
System.Web.CallHandlerExecutionStep.OnAsyncHandlerCompletion(IAsyncResult ar)+177

萬一這對其他任何人都證明是有用的,這是我們的構建腳本的一個問題,該腳本創建的端點地址中帶有額外的字符,很明顯,然后這些地址與綁定不匹配…… 就像錯誤消息是一直告訴我們

如果看到類似的錯誤,請三重檢查提供的服務端點地址是否確實與您在IIS中設置的地址匹配。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM