I’ve built a SOAP Webservice with SOAPCore. Its all working as expected except the error handling. The returned HTTP Status code is always 500 and I want to return 400 on occasions when it’s a user error.
I can override the Fault Body Writer and send a custom message but the not the Status code.
Does anyone have a suggestion on how I can achieve this?
I have tried to set the Status code to 400 before throwing an error but it get overwritten.
New contributor
Paul Scott is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.