none
Regarding base address RRS feed

  • Question

  • Hi,

    i have created wcf service usnig wcf service application project.After that i created a web application for self hosting where on button click i have written the following code

       protected void Button1_Click(object sender, EventArgs e)
            {

                ServiceHost hs = new ServiceHost(typeof(Student_WCF_ServiceApplication.Service1));
                hs.Open();
                
            }

    following is my config file for self hosting application.

    <?xml version="1.0"?>
    <configuration>

        <system.web>
          <compilation debug="true" targetFramework="4.0" />
        </system.web>

        <system.serviceModel>
            <behaviors>
                <serviceBehaviors>
                    <behavior name="NewBehavior0">
                        <serviceMetadata httpsGetEnabled="true" />
                    </behavior>
                </serviceBehaviors>
            </behaviors>
            <services>
                <service behaviorConfiguration="NewBehavior0" name="Student_WCF_ServiceApplication.Service1">
                    <clear />
                    <endpoint address="basic" binding="basicHttpBinding" name="en1"
                        contract="Student_WCF_ServiceApplication.IStudentService"
                        listenUriMode="Explicit">
                       
                    </endpoint>
                    <endpoint address="mex" binding="mexHttpBinding" bindingConfiguration=""
                        name="en2" contract="IMetadataExchange" />
                    <host>
                        <baseAddresses>
                            <add baseAddress="http://localhost:6386/StudentService.svc/" />
                        </baseAddresses>
                    </host>
                </service>
            </services>
        </system.serviceModel>
    </configuration>

    but while running the self host application i am getting following error.

    Could not find a base address that matches scheme http for the endpoint with binding BasicHttpBinding. Registered base address schemes are [].

    i just wanted to know where in the config file should i make changes to remove above mentioned error.

    Thursday, June 20, 2013 2:53 PM

Answers