Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / November 2004

Tip: Looking for answers? Try searching our database.

Debugging HTTP 500 errors

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Marcel van Brakel - 25 Nov 2004 13:55 GMT
Hi,

I have an ASP.NET webservice that is working ok most of time, but quite
frequently the IIS log shows a status 500 being returned to the (.NET)
client. The problem is, I have no idea why this is happening. I'm logging
all SOAP requests/responses to a file using slightly modified example code
from MSDN (using a SOAP extension), and I don't see any faults happening
(I've already tried disabling the logging, didn't make a difference). The
SQL Server and Windows Event logs don't show anything out out of the
ordinary either. Does anybody have any advice on how to go about and debug
this kind of problem?

Some more details:

- Windows 2000 Server with the latest service pack and updates.
- .NET 1.1
- VS.NET 2003
- Webservice protected using basic authentication.
- SQL Server 2000 with the latest service pack and updates.

The webservice methods themselves don't really do anything exciting.
Basically just simple selects/inserts/updates on the SQL Server database.
Most of them are no more than 15 lines of code including error handling..

Help would be very much appreciated.

best regards,
Marcel van Brakel
Marcel van Brakel - 25 Nov 2004 21:06 GMT
Hmm, I think I need to get back to the basics. I completely forgot that
exceptions/faults are returned with status 500 (it also makes me reconsider
my usage of exceptions to signal valid error conditions). My questions still
stands though, sort of anyway. Suppose for a minute that these 500's weren't
the result of an exception, how would I go about and find out what is
causing them? Or put differently, since Application.OnError isn't triggered
for web services, are there any errors that won't be logged by the
SoapExtension, and can I somehow access those?

best regards,
Marcel van Brakel

> Hi,
>
[quoted text clipped - 24 lines]
> best regards,
> Marcel van Brakel
[MSFT] - 26 Nov 2004 02:39 GMT
Hello Marcel ,

HTTP 500 error is a generic error which may be caused by many issues, for
example, authentication, internal code or even request/response size. From
your description, it seems to be a IIS issue, not related to your code. Can
you find anything wrong in system event log? Or you can enable more
extended loging options in IIS log, for example, service name, host and  
bytes recieved, Can you found some common rules for the 500 error logged?

Luke
Marcel van Brakel - 26 Nov 2004 07:06 GMT
Luke,

Thanks for the quick response. It turned out that one of my methods was
throwing exceptions. Since this method didn't have logging turned on I
initially couldn't match those 500's to faults.  I'm still wondering,
though, where exactly in the ASP.NET architecture/HTTP pipeline does a SOAP
extension plug in? Or put differently, are there any errors that might occur
within ASP.NET that I won't be able to see using a SOAP extension? And if
so, how can I monitor those?

best regards,
Marcel van Brakel
[MSFT] - 29 Nov 2004 02:38 GMT
Hi Marcel,

The pipeline of an ASP.NET web service is like:

HttpRequest ---> IIS ASP.NET Filter --> SOAP extension --> Web Service Class

Web Service Class --> SOAP extension --> IIS ASP.NET Filter --> HttpResponse

For more information about HTTP Pipelines in ASP.NET:

http://msdn.microsoft.com/msdnmag/issues/02/09/HTTPPipelines/default.aspx

To catch/hanlde an exception in the web service, I think the best way is
catch the exception in code ans throw a soapexception. You may refer to
following article to see if it will help:

Handling and Throwing Exceptions in XML Web Services
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/htm
l/cpconhandlingraisingexceptionsinxmlwebservices.asp

Luke

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.