简体   繁体   English

WCF:没有协议绑定与给定地址匹配

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

There are several other questions relating to this error (most regarding relative addresses - these are not what I'm looking for as we arent using a relative address) 还有与此错误相关的其他几个问题(大多数与相对地址有关-这些不是我在寻找相对地址时要查找的内容)

We have a WCF service which is deployed on several environments without issue - but on the latest installation on a closed network (using https) we are receiving the error: 我们提供了WCF服务,该服务可以在多个环境中正常部署-但是在封闭网络(使用https)上的最新安装中,我们会收到以下错误消息:

No protocol binding matches the given address ' https://domain.local/programmeservice.svc '. 没有协议绑定与给定地址“ https://domain.local/programmeservice.svc ”匹配。 Protocol bindings are configured at the Site level in IIS or WAS configuration. 协议绑定是在IIS或WAS配置的站点级别配置的。

We can access to root of the site fine (using https), so we are pretty sure it is a configuration issue with our binding - but we're out of ideas. 我们可以很好地访问站点的根目录(使用https),因此我们可以确定这是我们绑定的配置问题-但我们没有主意。

The web.config configuration for the service is as follows: 该服务的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>

The full stacktrace of the error is: 错误的完整堆栈跟踪为:

[InvalidOperationException: No protocol binding matches the given address ' https://domain.local/programmeservice.svc '. [InvalidOperationException:没有协议绑定匹配给定地址' https://domain.local/programmeservice.svc '。 Protocol bindings are configured at the Site level in IIS or WAS configuration.] 协议绑定是在IIS或WAS配置的站点级别配置的。]
System.ServiceModel.Activation.HostedAspNetEnvironment.GetBaseUri(String transportScheme, Uri listenUri) +154751 System.ServiceModel.Activation.HostedAspNetEnvironment.GetBaseUri(字符串transportScheme,Uri listenUri)+154751
System.ServiceModel.Channels.TransportChannelListener.OnOpening() +16284708 System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) +255 System.ServiceModel.Channels.TransportChannelListener.OnOpening()+16284708 System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan超时)+255
System.ServiceModel.Dispatcher.ChannelDispatcher.OnOpen(TimeSpan timeout) +72 System.ServiceModel.Dispatcher.ChannelDispatcher.OnOpen(TimeSpan超时)+72

[InvalidOperationException: The ChannelDispatcher at ' https://domain.local/programmeservice.svc ' with contract(s) '"ProgrammeService"' is unable to open its IChannelListener.] [InvalidOperationException:带有合同'“ ProgrammeService”'的位于https://domain.local/programmeservice.svc的ChannelDispatcher无法打开其IChannelListener。
System.ServiceModel.Dispatcher.ChannelDispatcher.OnOpen(TimeSpan timeout) +145 System.ServiceModel.Dispatcher.ChannelDispatcher.OnOpen(TimeSpan超时)+145
System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) +301 System.ServiceModel.ServiceHostBase.OnOpen(TimeSpan timeout) +130 System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan超时)+301 System.ServiceModel.ServiceHostBase.OnOpen(TimeSpan超时)+130
System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) +301 System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan超时)+301
System.ServiceModel.HostingManager.ActivateService(ServiceActivationInfo serviceActivationInfo, EventTraceActivity eventTraceActivity) +129 System.ServiceModel.HostingManager.ActivateService(ServiceActivationInfo serviceActivationInfo,EventTraceActivity eventTraceActivity)+129
System.ServiceModel.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath, EventTraceActivity eventTraceActivity) +741 System.ServiceModel.HostingManager.EnsureServiceAvailable(字符串normalizedVirtualPath,EventTraceActivity eventTraceActivity)+741

[ServiceActivationException: The service '/programmeservice.svc' cannot be activated due to an exception during compilation. [ServiceActivationException:由于编译期间发生异常,因此无法激活服务'/programmeservice.svc'。 The exception message is: The ChannelDispatcher at ' https://domain.local/programmeservice.svc ' with contract(s) '"ProgrammeService"' is unable to open its IChannelListener..] 异常消息是:带有合同“ ProgrammeService”的“ https://domain.local/programmeservice.svc ”处的ChannelDispatcher无法打开其IChannelListener。
System.Runtime.AsyncResult.End(IAsyncResult result) +607194 System.Runtime.AsyncResult.End(IAsyncResult结果)+607194
System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result) +231 System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult结果)+231
System.Web.CallHandlerExecutionStep.OnAsyncHandlerCompletion(IAsyncResult ar) +177 System.Web.CallHandlerExecutionStep.OnAsyncHandlerCompletion(IAsyncResult ar)+177

In the unlikely event that this proves useful to anyone else - this turned out to be a problem with our build scripts which were creating endpoint addresses with extra character in them, which obviously then didnt match the bindings... just like the error message was telling us the whole time . 万一这对其他任何人都证明是有用的,这是我们的构建脚本的一个问题,该脚本创建的端点地址中带有额外的字符,很明显,然后这些地址与绑定不匹配…… 就像错误消息是一直告诉我们

If you're seeing similar errors, triple check that the provided service endpoint address really matches what you've set up in IIS. 如果看到类似的错误,请三重检查提供的服务端点地址是否确实与您在IIS中设置的地址匹配。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 WCF找不到与绑定MetadataExchangeHttpBinding的端点的方案http匹配的基地址 - WCF Could not find a base address that matches scheme http for the endpoint with binding MetadataExchangeHttpBinding WCF错误。 找不到与绑定WSHttpBinding的端点的方案http匹配的基地址 - Error with WCF. Could not find a base address that matches scheme http for the endpoint with binding WSHttpBinding wcf找不到与绑定BasicHttpsBinding的端点的方案https匹配的基地址。 - wcf Could not find a base address that matches scheme https for the endpoint with binding BasicHttpsBinding. Wcf https ssl中的服务端点出错。 使用绑定WebHttpBinding找不到与方案http匹配的终点的基址 - Error With service endpoint in wcf https ssl. Cannot find base address that matches scheme http for the end point with binding WebHttpBinding WCF Web服务错误:“服务端点绑定不使用HTTP协议”? - WCF Web Service error: “Service endpoint binding not using HTTP protocol”? 如何向现有绑定添加自定义WCF协议通道 - How to add a custom WCF-Protocol-Channel to existing Binding WCF 异常:找不到与端点的方案 http 匹配的基地址 - WCF Exception: Could not find a base address that matches scheme http for the endpoint 我应该使用 WCF 来实现给定的二进制网络协议吗? - Should I use WCF to implement a given binary network protocol? 找不到与绑定WSHttpBinding的端点的scheme http匹配的基址 - Could not find a base address that matches scheme http for the endpoint with binding WSHttpBinding 找不到与绑定BasicHttpBinding的端点的方案https匹配的基址 - Could not find a base address that matches scheme https for the endpoint with binding BasicHttpBinding
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM