I am new to WCF in general. What little experience I get from using fairly simple .SVC services in ASP.NET web applications.
I first tried to experiment using the WCF project and ran into a major show stop.
As I am sure, most of them know for some strange reason in a web application in which customErrors mode is set to On
<customErrors mode = "On" />
Services (such as .ASMX and .SVC) will not return exception details to the client. Instead, the exception and stack traces are freed, and the message always reads "Request processing failed", which is not at all useful.
When services are directly hosted within the web application itself, it is easy to circumvent this limitation by placing the services in a dedicated folder and setting customErrors to “Off” for that folder.
However, Im works on the same issue with exceptions that are not returned from services that live in a separate WCF project. The fact is, I don’t know how to get around this.
In short: I need my WCF project services to throw REAL exceptions to the client — or at least the original exception message instead of “Request processing failed”.
EDIT . I should probably point out that the reason I want to throw exceptions is because I often call these services from the client side through Ajax (jQuery) and would like to format the returned message differently if it's "normal "return (for example, use green text), and then use red text if it is an error. I handle message formatting in the error handler of the $ .ajax object, which, obviously, will only be executed when the service fails.
I should also point out that everything works fine with customErrors Off:
<customErrors mode = "Off" />
So, I think maybe there is some kind of configuration property that can be configured to stop ASP.NET runtime from my exception when using customErrors.
There is some related information here that I found on this.