'BizTalk 2016 AfterReceiveReply not called

In BizTalk I try to send a message to Restful WebServices. I use a Static Send port Two-Way Wcf-WebHttp with a custom behavior for intercept Message http status Code. When I debugging Behavior is invoked only the BeforeSendRequest method and after this return directly in Biztalk Port , ignoring the AfterReceiveReply . The generic error that I retrieve is :

'Microsoft.XLANGs.Core.XlangSoapException' occurred in Microsoft.XLANGs.BizTalk.Engine.dll but was not handled in user code.'

and also,

"An error occurred while processing the message, refer to the details section for more information \r\nMessage ID: {F49A2AF6-8041-4BAC-B26A-F8BAE6C0293E}\r\nInstance ID: {B5075FDC-AEBA-4A0E-9220-5512E51990A8}\r\nError Description: System.Net.WebException: The remote server returned an unexpected response: (400) BadRequest.\r\n{here the custom json response}]}\r\n"}

Why AfterReceiveReply is not called?

There is any other Wcf interfaces that I can use in Behavior to receive only the custom json response in BizTalk Orchestration?



Solution 1:[1]

Can it be due to the REST service didn't accept the message (Bad Request) and WCF process don't reach the stage of ReceiveRepply? My suggestion is to fix the request so you don't get Bad Request and then continue the trouble shooting.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Martin Bring