How catch http 400 Status from Rest Service in BizTalk Orchestration

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-11 16:58:52

问题


On BizTalk 2013/R2 (CU6), I have seen another app/orchestration in my current client that seems to be doing this, but my app/orchestration is not.

I cloned their send port by doing export, editing, and then importing, changing only name, and operation/method binding. It has the "enable routing for failed messages checked".

Looks like I am catching it in the orchestration with a System.Exception, but I still see the SendPort suspended (resumable), and a routing error (nonresumeable).

Sample error that I'm catching (I'm forcing the error on purpose to test the error handling).

System.Net.WebException: The remote server returned an unexpected response: (400) Bad Request. {"httpStatusCode":400,"httpMessage":"Bad Request","errorMessage":"Unable to handle shipment request","errors":[{"severity":"ERROR","message":"No credentials were found for this vendor. Did you add them to ABC dashboard?","source":"SYSTEM"}],"supportReferenceId":"31eee61a-8770-4524-bada-2d906a53ab48"}

I've seen some other blogs and questions indicate that 500 errors are not returned, and that the http status is not set. But I haven't seen anything about the Suspended SendPorts. Also seems like earlier today, my System.Exception was not catching it, but I cannot go back in time to be sure.

I have retry count on the SendPort to 0.

Also, what actually determines which http statuses can get back to the orchestration? My colleague's code checked for 400, 401, and 403 as well.

Related question: BizTalk Catch Http Response Code

Update: My colleague is on another team, but I heard back from her. She had another orchestration that just "eats" the error message to avoid errors.


回答1:


There shouldn't be anything special about Http errors vs any other hard fault. They're raised back to the Orchestration just the same.

Here's an article on handling errors in Orchestrations with some useful techniques.

BizTalk Server: Suspend and Resume an Orchestration on Two Way Port Error



来源:https://stackoverflow.com/questions/49563450/how-catch-http-400-status-from-rest-service-in-biztalk-orchestration

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!