1
votes

I've been struggling with reconfiguring a working service to add a netTcp endpoint.

The service is hosted on IIS 8.5

I've been getting the following exception:

Could not find a base address that matches scheme net.tcp for the endpoint with binding NetTcpBinding. Registered base address schemes are [http,https]

Stack trace:

[InvalidOperationException: Could not find a base address that matches scheme net.tcp for the endpoint with binding NetTcpBinding. Registered base address schemes are [http,https].]
System.ServiceModel.ServiceHostBase.MakeAbsoluteUri(Uri relativeOrAbsoluteUri, Binding binding, UriSchemeKeyedCollection baseAddresses) +16994291
System.ServiceModel.Description.ConfigLoader.LoadServiceDescription(ServiceHostBase host, ServiceDescription description, ServiceElement serviceElement, Action`1 addBaseAddress, Boolean skipHost) +1092
System.ServiceModel.ServiceHostBase.LoadConfigurationSectionInternal(ConfigLoader configLoader, ServiceDescription description, ServiceElement serviceSection) +89
System.ServiceModel.ServiceHost.ApplyConfiguration() +162
System.ServiceModel.ServiceHostBase.InitializeDescription(UriSchemeKeyedCollection baseAddresses) +207 System.ServiceModel.ServiceHost..ctor(Type serviceType, Uri[] baseAddresses) +474
System.ServiceModel.Activation.ServiceHostFactory.CreateServiceHost(Type serviceType, Uri[] baseAddresses) +42
System.ServiceModel.Activation.ServiceHostFactory.CreateServiceHost(String constructorString, Uri[] baseAddresses) +569
System.ServiceModel.HostingManager.CreateService(String normalizedVirtualPath, EventTraceActivity eventTraceActivity) +1435
System.ServiceModel.HostingManager.ActivateService(ServiceActivationInfo serviceActivationInfo, EventTraceActivity eventTraceActivity) +76
System.ServiceModel.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath, EventTraceActivity eventTraceActivity) +901

[ServiceActivationException: The service '/servicebus.svc' cannot be activated due to an exception during compilation. The exception message is: Could not find a base address that matches scheme net.tcp for the endpoint with binding NetTcpBinding. Registered base address schemes are [http,https]..]
System.Runtime.AsyncResult.End(IAsyncResult result) +624522
System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result) +196075
System.Web.AsyncEventExecutionStep.OnAsyncEventCompletion(IAsyncResult ar) +166

  <services>
  <service name="Niloosoft.ServiceBus" behaviorConfiguration="AuthenticationAndAuthorizationSecurity">
    <host>
      <baseAddresses>
        <add baseAddress="net.tcp://localhost:7213"/>
      </baseAddresses>
    </host>

    <endpoint
      address="secureBus"
      binding="basicHttpBinding"
      bindingConfiguration="TransportSecurity"
      contract="Niloosoft.IServiceBus" />
    <endpoint
      address="tcpBus"
      binding="netTcpBinding"
      bindingConfiguration="ServiceBusTcpBinding"
      contract="Niloosoft.IServiceBus" />
    <endpoint
     address="tcpMex"
     binding="mexTcpBinding"
     contract="IMetadataExchange" />
    <endpoint
      address="mex"
      binding="mexHttpsBinding"
      contract="IMetadataExchange" />
  </service>
</services>

The binding configurations seem to work well for other services but I may be missing something else.

IIS has binding configuration for each service, I added a tcp binding there with *:7213 address.

Any suggestions, ideas as to what I'm missing? I went through a lot of different posts to see if perhaps I made an error somewhere.

All help is appreciated.

1
You need to add and enable net.tcp binding in IIS. Read this: rohitguptablog.wordpress.com/2011/06/16/…1.618
The article was very helpful, although the IIS wasn't the problem, the configurations were off. thanks! EDIT: for those interested in what went wrong here, it was the httpgetenabled=true that causes the issue. it needs to be set to false.Midnight_Blaze

1 Answers

0
votes

The issue was that the configuration HttpGetEnabled was set to true, it is necessary to set it to false if your webservice should accept HTTPS.