Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7715113
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T02:18:17+00:00 2026-06-01T02:18:17+00:00

In Fiddler, I can pass in a request and get a response 500. Fine

  • 0

In Fiddler, I can pass in a request and get a response 500. Fine by me, I want my .NET code to handle this AND analyze the response message. In the case below there is a meaningful message. Yet using HttpWebRequest and HttpWebResponse, I cannot get that information.

Here is the response from Fiddler:

HTTP/1.1 500 Internal Server Error
Date: Sun, 25 Mar 2012 15:50:31 GMT
Transfer-Encoding: chunked
Content-Type: text/xml; charset=ISO-8859-1
X-Powered-By: Servlet/2.5 JSP/2.1

010e
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><soap:Fault><faultcode>soap:Client</faultcode><faultstring>WSS header is missing from request. Can't do username token authentication.</faultstring></soap:Fault></soap:Body></soap:Envelope>
0000

Here is my code which tries to catch the exception:

        try
        {
            HttpWebResponse resp2 = (HttpWebResponse) req.GetResponse();
        }
        catch (WebException ex)
        {
            WebException we = (WebException) ex;
            HttpWebResponse respp = (HttpWebResponse) we.Response;
            log.Info((int)respp.StatusCode);
            log.Error(ex.ToString());
        }

I just cannot get anything more from the exception object. But I know the response should be readable. Hopefully there are lower-level http classes I can use that I just don’t know about now. I don’t want .NET protecting me from the real HTTP protocols.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T02:18:18+00:00Added an answer on June 1, 2026 at 2:18 am

    It’s not clear what you’ve tried to do with respp. (I note that you’re not using resp2, either.) For example, what does this do:

    catch (WebException ex)
    {
        using (HttpWebResponse respp = (HttpWebResponse) ex.Response)
        {
            log.Info((int)respp.StatusCode);
            log.Error(ex.ToString());
            log.Error(new StreamReader(respp.GetResponseStream()).ReadToEnd());
        }
    }
    

    (It’s never been clear to me whether you really need to dispose of a WebResponse obtained in a WebException, but it’s probably a good idea. You might want to dispose of the response stream as well, although I believe disposing of the response is good enough.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

fiddle code: <button onclick=this.disabled=true; setTimeout(function(){this.disabled=false;},500);>click</button> this seems to refer to the window rather than
I usually use Fiddler to monitor HTTP request and response, but if it is
As per msdn link i was testing GET request with fiddler but it gives
How can I use Fiddler to check the response from a web server. I
You can find my jQuery in this fiddle http://jsfiddle.net/qSkZW/9/ where the value changes based
Like in fiddler you can watch the logs between client and server. Like fiddler;
With the help of fiddler, I did this replay attack with the following HTTP
I need to do a getJSON() request, but how do I pass authorisation and
Fiddle me this: http://jsfiddle.net/TrySpace/QZMP6/17/ After editing the input field, the html updates on each
So I can call my IPN handling page (an aspx page) happily using Fiddler

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.