Debugging HTTP 500 errors

Discussion in 'ASP .Net Web Services' started by Marcel van Brakel, Nov 25, 2004.

  1. 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, Nov 25, 2004
    #1
    1. Advertising

  2. 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

    "Marcel van Brakel" <> wrote in message
    news:...
    > 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, Nov 25, 2004
    #2
    1. Advertising

  3. Marcel van Brakel

    [MSFT] Guest

    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
    [MSFT], Nov 26, 2004
    #3
  4. 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
    Marcel van Brakel, Nov 26, 2004
    #4
  5. Marcel van Brakel

    [MSFT] Guest

    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
    [MSFT], Nov 29, 2004
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Dean R. Henderson
    Replies:
    4
    Views:
    470
    Dean R. Henderson
    Nov 11, 2003
  2. NNTP
    Replies:
    2
    Views:
    985
    =?Utf-8?B?S2V2aW4gVG9kZA==?=
    Mar 18, 2005
  3. =?Utf-8?B?TWFydGlu?=
    Replies:
    0
    Views:
    489
    =?Utf-8?B?TWFydGlu?=
    Sep 20, 2006
  4. CS Kev
    Replies:
    2
    Views:
    341
    Cowboy \(Gregory A. Beamer\)
    Oct 19, 2006
  5. Gary L
    Replies:
    2
    Views:
    1,508
    Gary L
    Mar 3, 2008
Loading...

Share This Page