We currently have a working REST WCF service. I'm trying to implement a custom behavior for error handling that will return a custom JSON object. I believe the article found here WCF Exception Handling with IErrorHandler will do the trick, however, the example shows how to add the behavior via code. We're hosting the service via IIS and have no ServiceHost. Can anyone direct me as to how to add my custom error handling class to the web.config?
I've searched all over Google and SO and have found a number of examples that are doing close to what I'm trying to accomplish but my understanding of WCF is probably prohibiting me from fully comprehending.
Here is all we have configured for the endpoints.
<standardEndpoints>
<webHttpEndpoint>
<!--
Configure the WCF REST service base address via the global.asax.cs file and the default endpoint
via the attributes on the <standardEndpoint> element below
-->
<standardEndpoint helpEnabled="true" automaticFormatSelectionEnabled="false"/>
</webHttpEndpoint>
</standardEndpoints>
<behaviors>
<serviceBehaviors>
<behavior>
<!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
</behaviors>