How do I solve error StatusCode: 500?
-
I am getting an error when I try to get case information from a database (Justice) Here is the error: {StatusCode: 500, ReasonPhrase: 'Internal Server Error', Version: 1.1, Content: System.Net.Http.StreamContent, Headers: {Pragma: no-cache Cache-Control: no-cache Date: Wed, 29 Jan 2020 22:07:12 GMT Server: Microsoft-IIS/8.0 X-AspNet-Version: 4.0.30319 X-Powered-By: ASP.NET Content-Length: 6066 Content-Type: application/json; charset=utf-8 Expires: -1 }} I need help to solve the error StatusCode: 500 When button is clicked JusticeContoller class is called. This is where I am getting an error on line response=await client.GetAsync("api/GetAllAcceptCAseNumbers/" + candidateCases);
protected async void GetCasesButton_Click(object sender, EventArgs e)
{
//#region Required Field Validation
if (CaseNumbersTextBox.Text.Length < 1)
{
string myStringVariable = "Case number textbox cannot be empty.";
ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + myStringVariable + "');", true);
return;
}
try
{
#region Get Batch Number
int newBatchNumber = await CandidateCaseController.GetNextBatchNumber();
#endregion
#region Insert entered case numbers in database
foreach (string caseNumber in userEnteredCaseNumberList)
{
EditCandidateCaseModel newCandidate = new EditCandidateCaseModel();
newCandidate.CaseNbr = caseNumber;
newCandidate.EntryStaffUserName = Helpers.Authentication.GetADEmail();
await CandidateCaseController.PostCandidate(newCandidate);
}
#region Get MNCIS info on cases
//candidateCasesString
List smallEnoughStrings = new List();
List mncisDetailList = new List();
List smallEnoughMncisDetailList = new List();
foreach (string smallEnoughString in smallEnoughStrings)
{
smallEnoughMncisDetailList = await FTACaseReseting.Controllers.JusticeController.GetAllAcceptCaseNumbers(smallEnoughString);
mncisDetailList.AddRange(smallEnoughMncisDetailList);
}
#endregion} catch (Exception ex) { string errorMsg = string.Format("An error has occured in {0}. \\nException:\\n{1}"
-
I am getting an error when I try to get case information from a database (Justice) Here is the error: {StatusCode: 500, ReasonPhrase: 'Internal Server Error', Version: 1.1, Content: System.Net.Http.StreamContent, Headers: {Pragma: no-cache Cache-Control: no-cache Date: Wed, 29 Jan 2020 22:07:12 GMT Server: Microsoft-IIS/8.0 X-AspNet-Version: 4.0.30319 X-Powered-By: ASP.NET Content-Length: 6066 Content-Type: application/json; charset=utf-8 Expires: -1 }} I need help to solve the error StatusCode: 500 When button is clicked JusticeContoller class is called. This is where I am getting an error on line response=await client.GetAsync("api/GetAllAcceptCAseNumbers/" + candidateCases);
protected async void GetCasesButton_Click(object sender, EventArgs e)
{
//#region Required Field Validation
if (CaseNumbersTextBox.Text.Length < 1)
{
string myStringVariable = "Case number textbox cannot be empty.";
ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('" + myStringVariable + "');", true);
return;
}
try
{
#region Get Batch Number
int newBatchNumber = await CandidateCaseController.GetNextBatchNumber();
#endregion
#region Insert entered case numbers in database
foreach (string caseNumber in userEnteredCaseNumberList)
{
EditCandidateCaseModel newCandidate = new EditCandidateCaseModel();
newCandidate.CaseNbr = caseNumber;
newCandidate.EntryStaffUserName = Helpers.Authentication.GetADEmail();
await CandidateCaseController.PostCandidate(newCandidate);
}
#region Get MNCIS info on cases
//candidateCasesString
List smallEnoughStrings = new List();
List mncisDetailList = new List();
List smallEnoughMncisDetailList = new List();
foreach (string smallEnoughString in smallEnoughStrings)
{
smallEnoughMncisDetailList = await FTACaseReseting.Controllers.JusticeController.GetAllAcceptCaseNumbers(smallEnoughString);
mncisDetailList.AddRange(smallEnoughMncisDetailList);
}
#endregion} catch (Exception ex) { string errorMsg = string.Format("An error has occured in {0}. \\nException:\\n{1}"
An internal server error just means something has gone wrong in the server-side code. You'll need the actual error details to work out what the problem is. Assuming the error is coming from the
GetAllAcceptCaseNumbers
method, the problem is with the service you're calling, not the code you've shown. You'll need to contact the developer(s) responsible for that service to fix the problem.
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
-
An internal server error just means something has gone wrong in the server-side code. You'll need the actual error details to work out what the problem is. Assuming the error is coming from the
GetAllAcceptCaseNumbers
method, the problem is with the service you're calling, not the code you've shown. You'll need to contact the developer(s) responsible for that service to fix the problem.
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
Thank you for your response. You are exactly right. I did talk to someone and I need to get username and password the app need to use to connect to the server.