While using a client to connect and fetch data from a WCF service, you may encounter an error and see the following message displayed on the screen:
Error: The server was unable to process the request due to an internal error.
For more information about the error, either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the
This happens when any type of error occurs calling a WCF endpoint from a client. The client sees this generic message, as given above, for security reason. If you want to see the full details of the error in the client, you will need to modify the config file of the WCF Host to include full exception details when sending the error to the client.
- <!-- Step 1. Add a behaviorConfiguration attribute -->
- <add baseAddress="http://localhost:8080/SampleService" />
- <!-- Step 2. Add a new behavior below.-->
- <behavior name="metadataAndDebug">
- <serviceMetadata httpGetEnabled="true" httpGetUrl=""/>
- <!-- Step 3. Add a <serviceDebug> element -->
- <serviceDebug httpHelpPageEnabled="true" includeExceptionDetailInFaults="true" />
Please note that there is an inherent security issue if this setting is left to 'true' for your production environment. Please see the MSDN article here for more details.