Last post Mar 02, 2021 11:11 PM by DA924
Mar 02, 2021 03:31 AM|wavemaster|LINK
Data returned from a form is newService.
In the AddService() method I create and populate the Service and Provider Service Entities which are related.
There are two HTTP Post attempts that succeed as far as new records in the tables, however response.Result and response1.Result both have the IsSuccessStatusCode flag set to FALSE and each report Internal Server Error.
No further clues are offered what is the problem.
Maincat: "Add On"
ProviderServices: Count = 0
ServiceName: "test no. 3"
ShortForm: "test no. 3"
NegotiatedProviderServices: Count = 0
ProviderRxTransactions: Count = 0
ProviderSvcTransactions: Count = 0
Why the internal server errors if the HTTP Post complete?
And, note the highlighted 250 which is the hard coded ServiceId,
what is the mechanism to get that returned as part of <response>?
Mar 02, 2021 11:11 PM|DA924|LINK
The HTTP 500 means that the code running on the Web server through an exception. The exception was swallowed by the Web server that through the HTTP 500, because there was no exception handling to catch and log the exception for review, which happened after
the save of data.
How to Catch All Exceptions in C# & Find All Application Errors – Stackify
The WebAPI project in the on the GitHub solution implements the ErrorHandlingFilter class that catches all unhandled exception there are no try/catch in the WebAPI or the DAL code it references the error filter code catches the exception.
The corrected link is now given.