none
when I set the uri in the service host, I get the error: this collection has and addres with the schema http RRS feed

  • Question

  • I have a self host service in a console application and I am using WCF 4.5. Also I am try to test in a local machine.

    This is the config file:

    <system.serviceModel>
        <services>
          <service name="WCFCalculadoraService.CalculadoraService">
            <endpoint address="" binding="netHttpBinding" contract="WCFCalculadoraService.ICalculadoraService">
              <identity>
                <dns value="localhost" />
              </identity>
            </endpoint>
            <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
            <host>
              <baseAddresses>
                <add baseAddress="http://localhost:8733/Design_Time_Addresses/WCFCalculadoraService/Service1/" />
              </baseAddresses>
            </host>
          </service>
        </services>
    
    
        <behaviors>
          <serviceBehaviors>
            <behavior>
              <serviceMetadata httpGetEnabled="false" httpsGetEnabled="False"/>
              <serviceDebug includeExceptionDetailInFaults="False" />
            </behavior>
          </serviceBehaviors>
        </behaviors>
      </system.serviceModel>

    And this is my code in my console application:

    ServiceHost miHost = new ServiceHost(typeof(WCFCalculadoraService.CalculadoraService));

            miHost = new ServiceHost(typeof(WCFCalculadoraService.CalculadoraService), 
                new Uri("http://localhost:8733/Design_Time_Addresses/WCFCalculadoraService/Service1/"));
            try
            {
                miHost.Open();
    
                Console.WriteLine("Service is host at " + DateTime.Now.ToString());
                Console.WriteLine("Host is running... Press <Enter> key to stop");
                Console.ReadLine();
            }
            catch(Exception ex)
            {
                Console.WriteLine("\r\n\r\n\r\n" + ex.Message);
            }
            finally
            {
                miHost.Close();
                miHost = null;
            }

    The problem is that I get an error that says this collection has and addres with the schema http. Only is allowed an address per collection in this schema.

    Thanks.


    Wednesday, December 2, 2015 9:40 AM

Answers

  • Hi ComptonAlvaro,

    According to this case, in my opinion, you can add the following node to app.config file.

    Like below:

    <system.serviceModel>  
       <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />  
    </system.serviceModel> 
    

    This node should be add as a child node behind <system. serviceModel>

    For more information, please refer to the following articles:

    1.WCF: This collection already contains an address with scheme http (Update)

    Best Regards,

    Grady

    • Marked as answer by ComptonAlvaro Thursday, December 3, 2015 10:06 AM
    Thursday, December 3, 2015 2:12 AM
    Moderator

All replies

  • Bing and Google are your friends.

    https://www.google.com/?gws_rd=ssl#q=this+collection+has+an+address+with+the+scheme+http.+Only+is+allowed+an+address+per+collection+in+this+schema.

    Wednesday, December 2, 2015 12:51 PM
  • Hi ComptonAlvaro,

    According to this case, in my opinion, you can add the following node to app.config file.

    Like below:

    <system.serviceModel>  
       <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />  
    </system.serviceModel> 
    

    This node should be add as a child node behind <system. serviceModel>

    For more information, please refer to the following articles:

    1.WCF: This collection already contains an address with scheme http (Update)

    Best Regards,

    Grady

    • Marked as answer by ComptonAlvaro Thursday, December 3, 2015 10:06 AM
    Thursday, December 3, 2015 2:12 AM
    Moderator