I have created a WCF Service Library in MVC project and set up MySerice.svc and Web.Config file in project as follow:
<!--added to run WCF service -->
<system.serviceModel>
<!-- this multipleSiteBindingsEnabled for remote access -->
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="True" />
<services>
<service name="SchoolProject.WCF.SchoolProjectService" behaviorConfiguration="ServiceBehaviour">
<endpoint address="" binding="webHttpBinding" contract="SchoolProject.WCF.ISchoolProjectService" behaviorConfiguration="web" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="ServiceBehaviour">
<serviceMetadata httpGetEnabled="True" />
<serviceDebug includeExceptionDetailInFaults="False" />
</behavior>
</serviceBehaviors>
<endpointBehaviors>
<behavior name="web">
<webHttp/>
</behavior>
</endpointBehaviors>
</behaviors>
</system.serviceModel>
<!-- end-->
The problem is when I run MySerice.svc file in browser it works fine but all other request made on http://localost:18457/MyService.svc/Anyrequest shows the error which is as like below: (Note: discard the svc file name and supplied url on picture)
I will appreciate if anyone can provide some code snippet. Thank you