While building WCF REST service if you get below error message
Image 1 WCF REST service if you get below error message
Then make sure your WCF service Project’s web.config file should have below System.ServiceModel setting.
- <system.serviceModel>
- <behaviors>
- <serviceBehaviors>
- <behavior>
- <!-- To avoid disclosing metadata information, set the values below to false before deployment -->
- <serviceMetadatahttpGetEnabled="true"httpsGetEnabled="true"/>
- <!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information -->
- <serviceDebugincludeExceptionDetailInFaults="false"/>
- </behavior>
- </serviceBehaviors>
- <endpointBehaviors>
- <behavior>
- <webHttphelpEnabled="True"/>
- </behavior>
- </endpointBehaviors>
- </behaviors>
- <protocolMapping>
- <addbinding="webHttpBinding"scheme="http"/>
- </protocolMapping>
- <serviceHostingEnvironmentaspNetCompatibilityEnabled="true"multipleSiteBindingsEnabled="true"/>
- <standardEndpoints>
- <webScriptEndpoint>
- <standardEndpointname=""crossDomainScriptAccessEnabled="true"/>
- </webScriptEndpoint>
- </standardEndpoints>
- </system.serviceModel>
Now run your WCF REST service
Image 2 Service 1