Join 34,000+ subscribers and receive articles from our
blog about software quality, testing, QA and security.

GetResponse() return Exception - We do .Net integrated API update in Testrail .Net binding added


#1

Hi

we do API call through .Net Projects(.Net binding, Newtonsoft.Json). Previously own test server works fine, but we have migrated to new serve and existing code was not working.

Bellow Line in shows Exceoption:
response = (HttpWebResponse)request.GetResponse();

Exception message : _ComPLUSExceptionCode : -532462766

And below code returns:
string text = “”;
if (response != null)
{
var reader = new StreamReader(
response.GetResponseStream(),
Encoding.UTF8
);

			using (reader)
			{
				text = reader.ReadToEnd();
			}
		}

Content of text:

“\r\n<html xmlns=“http://www.w3.org/1999/xhtml”>\r\n\r\n<meta http-equiv=“Content-Type” content=“text/html; charset=iso-8859-1”/>\r\n401 - Unauthorized: Access is denied due to invalid credentials.\r\n<style type=“text/css”>\r\n\r\n\r\n\r\n\r\n<div id=“header”>

Server Error

\r\n<div id=“content”>\r\n <div class=“content-container”>\r\n

401 - Unauthorized: Access is denied due to invalid credentials.

\r\n

You do not have permission to view this directory or page using the credentials that you supplied.

\r\n \r\n\r\n\r\n\r\n”

We do see the user name has administrator privilege, but still are not able to figure out the issue.
If any one able to help would be greatfull.

Thanks,