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));

    following is my config file for self hosting application.

    <?xml version="1.0"?>

          <compilation debug="true" targetFramework="4.0" />

                    <behavior name="NewBehavior0">
                        <serviceMetadata httpsGetEnabled="true" />
                <service behaviorConfiguration="NewBehavior0" name="Student_WCF_ServiceApplication.Service1">
                    <clear />
                    <endpoint address="basic" binding="basicHttpBinding" name="en1"
                    <endpoint address="mex" binding="mexHttpBinding" bindingConfiguration=""
                        name="en2" contract="IMetadataExchange" />
                            <add baseAddress="http://localhost:6386/StudentService.svc/" />

    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