customErrors Not Working

N

Nicholas Nuss

Hello -

I am having difficulties using the customErrors tag in my web.config
of a web service I am creating. I am creating two proxies (stub
methods) on two seperate servers for security reasons. The final proxy
calls my real web service that does all of my work. The web service
that does the work calls a .dll on the same server as the web service.
The .dll calls a stored procedure and returns a dataset to my web
service. My web service then returns the dataset to the client. I am
using a .dll for logging and am using the Microsoft Exception Block
for exception handling.

The web service has the following tag in the web.config:

<customErrors mode="On" defaultRedirect="customerror.aspx"/>

I am hoping that when an error occurs in the web service, the
customerror.aspx page is displayed to the user. Right now, the page
that goes back to the user is the yellow ASP.NET exception page that
shows the stack trace and the source error.

I REALLY DON'T WANT MY CLIENTS SEEING THE STACK TRACE!!!!!!!!!

I am creating a soap exception and throwing it back to the client, so
if my client captures that soap exception and displays a message,
everything will work fine. But, since I am providing a web service, I
can't guarantee that the client will capture my soapexception message.

So, I did some research and read that you can either use the
customErrors tag in the web.config file of the web service, or use the
protected void Application_Error(Object sender, EventArgs e) method in
global.asax in the web service. Neither of these solutions work for
me. It is as if my client config is higher in the config hierarchy
(which may be so). My web service seems to completely ignore my config
settings and my global.asax.

If I use the <customErrors mode="On"
defaultRedirect="customerror.aspx"/> in my client, it works great.
But, the problem is, I can not control how the client consumes my web
service.

Does anyone know how to make sure my web service is using my
configuration file for customErrors? If not, is there something I am
missing that I should be aware of.

Thanks for any help you can provide:

Nicholas Nuss
C# Application Developer
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,996
Messages
2,570,238
Members
46,826
Latest member
robinsontor

Latest Threads

Top