Mark McWhirter
Mark McWhirter

Reputation: 1196

WCF Could not find a base address that matches scheme http for the endpoint with binding MetadataExchangeHttpBinding

I'm trying to get a wcf service working in a windows service host. I am currently receiving the error "Could not find a base address that matches scheme http for the endpoint with binding MetadataExchangeHttpBinding. Registered base address schemes are [net.tcp]."

I am using .Net Framework 4.5

I am trying to get a tcp.net binary service. Any help appreciated. The trace file that I have created isn't being helpful. Here's my [REVISED] app.config:

<?xml version="1.0" encoding="utf-8" ?>
<!-- IMPORTANT!  To run this on your local machine, first follow instructions in http://support2.microsoft.com/kb/2785590 -->
<!-- You will run into tcp listen errors otherwise -->
<configuration>
  <startup>
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
  </startup>


  <system.serviceModel>
    <services>
      <service name="SettingsDB.Configuration" behaviorConfiguration="DefaultBehavior">
        <endpoint binding="netTcpBinding" bindingConfiguration="max" contract="SettingsDB.IConfiguration" address="Settings" />
        <host>
          <baseAddresses>
            <add baseAddress="net.tcp://localhost:9000/SettingsService" />
          </baseAddresses>
        </host>
      </service>
    </services>
    <bindings>
      <netTcpBinding>
        <binding name="max" maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxConnections="2147483647" maxReceivedMessageSize="2147483647" listenBacklog="2147483647" transactionFlow="false" portSharingEnabled="true">
          <readerQuotas maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxDepth="2147483647" maxNameTableCharCount="2147483647" maxStringContentLength="2147483647" />
          <reliableSession enabled="false" />
          <security mode="None" />
        </binding>
      </netTcpBinding>
    </bindings>
    <behaviors>
      <serviceBehaviors>
        <behavior name="DefaultBehavior">
          <serviceMetadata httpGetEnabled="false" httpGetUrl="true" />
          <serviceDebug includeExceptionDetailInFaults="true" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>

  <system.diagnostics>
    <sources>
      <source name="System.ServiceModel" switchValue="Information, ActivityTracing" propagateActivity="true">
        <listeners>
          <add name="traceListener" type="System.Diagnostics.XmlWriterTraceListener" initializeData="c:\Traces.svclog" />
        </listeners>
      </source>
    </sources>
  </system.diagnostics>

  <system.web>
    <compilation debug="true" />
  </system.web>
  <runtime>
    <gcServer enabled="true" />
  </runtime>
</configuration>

Upvotes: 1

Views: 3033

Answers (1)

Noctis
Noctis

Reputation: 11763

can you try:

<service name="SettingsDB.Settings">

add name to the behavior and change the httpGetUrl to simply true

<behavior>
  <serviceMetadata httpGetEnabled="true" 
                   httpGetUrl="true"     />
  <serviceDebug includeExceptionDetailInFaults="true" />
</behavior>

Upvotes: 1

Related Questions