I'm using BizTalk Server 2020 One-way Receive Ports and One-way Send Ports with WCF-WebHttp adapters to handle asynchronous REST communication. I don't need to make any payload transformations, that's why for performance reasons I'm not using orchestrations.
I need to handle Error HTTP status codes that for some codes (e.g. 500) message will be suspended and for some (e.g. 400) it will be deleted.
BizTalk throws System.Net.WebException when a REST call returns an HTTP status code other than 2XX. Error code can only be read from its message. Also when exception is thrown code in Send Port behaviors and pipelines isn't invoked.
System.Net.WebException: The remote server returned an unexpected response: (400) Bad Request.
I know how to make Send Ports that listen for messages with ErrorType == FailedMessage and delete them, but I don't know how to create filter which only affects messages with certain HTTP status codes.
Is there any way to do it without orchestration?