简体   繁体   中英

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:

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.

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.

The web.config configuration for the service is as follows:

<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 '. 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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM