Thursday, May 26, 2011

Debug output from WCF 4.0 REST Template

To view exception details for WCF v4.0 REST Template (instead of the generic "Response Error" message) add faultExceptionEnabled="true" to <standardEndpoint>:

<system.serviceModel>
<standardEndpoints>
<webHttpEndpoint>
<standardEndpoint name="" helpEnabled="true" automaticFormatSelectionEnabled="true" faultExceptionEnabled="true">
...

Additionally, add includeExceptionDetailInFaults="true" to <system.serviceModel> for stack trace etc:

<behaviors>
<serviceBehaviors>
<behavior name="">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
</behaviors>

Also see::
http://stackoverflow.com/questions/2312894/wcf-data-service-how-to-diagnose-request-error

Ah, nice to get the WCF v4.0 REST template working under IIS6!

No comments:

Post a Comment