The below configuation to be added in the web.config or app.config for the proper functioning of WCF Service.
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="Service1_Behavior">
<serviceMetadata httpGetEnabled="True"/>
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service name="Namespace1.Service1"
behaviorConfiguration="Service1_Behavior">
<endpoint address="url of wcf service created" binding="basicHttpBinding" contract="Namespace1.IService1"/>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
</service>
</services>
</system.serviceModel>