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

  • Home
  • SEARCH
  • 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 7722547
In Process

The Archive Base Latest Questions

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

In .NET, I am calling a rest service and getting an exception – 500

  • 0

In .NET, I am calling a rest service and getting an exception – 500 Internal Server Error.

HttpWebResponse response = request.GetResponse() as HttpWebResponse

When I analyze this in Fiddler (in TextView), I am getting many details about the proper exception that caused the error.

In my exception object, I can’t get this information in the InnerException (it’s null) nor in the Response object itself.

Any ideas?

  • 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-01T04:12:21+00:00Added an answer on June 1, 2026 at 4:12 am

    Try looking at the WebException.Response Property:

    catch(WebException ex)
    {
        Console.WriteLine(ex.Message);
    
        if (ex.Status == WebExceptionStatus.ProtocolError)
        {
            Console.WriteLine("Status Code : {0}", ((HttpWebResponse)ex.Response).StatusCode);
            Console.WriteLine("Status Description : {0}", ((HttpWebResponse)ex.Response).StatusDescription);
    
            using (Stream responseStream = ex.Response.GetResponseStream())
            {
                if (responseStream != null)
                {
                    using (StreamReader responseReader = new StreamReader(responseStream))
                    {
                        Console.WriteLine(responseReader.ReadToEnd());
                    }
                }
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm getting this error when calling a java web service. I'm using the same
I'm calling the Bing Maps Service to return some XML here: http://dev.virtualearth.net/REST/v1/Locations/Encoded_Address?o=xml&key=Maps_Key For the
I am calling a WCF Service using AJAX.NET and wanted to know if the
I'm getting itermittent data loss when calling .NET [Console]::ReadLine() to read piped input to
Calling a .net SOAP1.1 web service from android using ksoap2 lib I met a
I have a WCF service implemented using the WebServiceHostFactory (REST). I'm calling a service
I am calling a .net web service from my android app with no luck.
I'm calling a .NET component from Classic ASP that has been created using Server.CreateObject.
I'm looking at using ASP.Net MVC as a platform for a REST based Service.
The case: There is a .net application calling unmanaged C code. Used method for

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.