I have a rest API with POST Method where I am posting and receiving success response as JSON format which works absolutely fine. During the failure I receive
Error details: System.Net.WebException: The remote server returned an unexpected response: (400) Bad Request The creation failed because the name or email address of the is invalid
Which I see in Application log and send port gets suspended. I need to capture this in the BizTalk Orchestration where I need to send email if I get any error response.
As the Error Response is not in JSON format don't know how it can be handled. Any idea?
ErrorReport.FailureCode Exists
to exclude your API send port if you only want to handle these in the Orchestration. If you don't have such a port, you might have to create one, and send the failed messages to a NULL adapter or similar.Exception = SystemException.ToString();
in an Expression shape where Exception is a System.String Variable, and SystemException is the Exception Object Name you defined in the Catch block.Exception.Contains("XXXX")
where XXXX is text in the exception, or handle it however you want.