Skip to main content
Solved

Using IFS Web Services in C# & XML Response Details

  • December 21, 2020
  • 1 reply
  • 334 views

baris.halici
Hero (Customer)
Forum|alt.badge.img+12

When the wrong answer(500) comes from Soap Web Services, i want to see the error details. I can use soap tool, i can do this process using a soap tool and see the error details(attch-1). But using the WebResponse class in c#, i cannot see the error details(attch-2).

Do you have any information on this subject?

attch-1
attch-1a
attch-2 on ms vs debug
ifs soap gateway documentation

  Thanks.

Best answer by baris.halici

HttpWebRequest Capture Response Even If 500 Internal Server Error Details:

Finally I have reached the right conclusion. And, I wanted to share thinking that someone might need it.

catch (WebException ex)
{
	string exMessage = ex.Message;

	if (ex.Response != null)
	{
		using (var responseReader = new StreamReader(ex.Response.GetResponseStream()))
		{
			exMessage = responseReader.ReadToEnd();
		}
	}
}

 

exception message details

I wish a healthy New Year for all of us!

View original
Did this topic help you find an answer to your question?
This topic has been closed for replies.

1 reply

baris.halici
Hero (Customer)
Forum|alt.badge.img+12
  • Author
  • Hero (Customer)
  • 127 replies
  • Answer
  • December 30, 2020

HttpWebRequest Capture Response Even If 500 Internal Server Error Details:

Finally I have reached the right conclusion. And, I wanted to share thinking that someone might need it.

catch (WebException ex)
{
	string exMessage = ex.Message;

	if (ex.Response != null)
	{
		using (var responseReader = new StreamReader(ex.Response.GetResponseStream()))
		{
			exMessage = responseReader.ReadToEnd();
		}
	}
}

 

exception message details

I wish a healthy New Year for all of us!


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings