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>
-
- <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
-
- <serviceDebug includeExceptionDetailInFaults="false" />
- </behavior>
- </serviceBehaviors>
- <endpointBehaviors>
- <behavior>
- <webHttp helpEnabled="True"/>
- </behavior>
- </endpointBehaviors>
- </behaviors>
- <protocolMapping>
- <add binding="webHttpBinding" scheme="http" />
- </protocolMapping>
- <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
- <standardEndpoints>
- <webScriptEndpoint>
- <standardEndpoint name="" crossDomainScriptAccessEnabled="true" />
- </webScriptEndpoint>
- </standardEndpoints>
- </system.serviceModel>
Now run your WCF REST service
Image 2 Service 1