2017-08-29 69 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中设置的内容是否相符。