BizTalk Catch Http响应代码 [英] BizTalk Catch Http Response Code

查看:189
本文介绍了BizTalk Catch Http响应代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个业务流程,该业务流程是从本地Rest服务接收请求,然后将请求发送到另一个远程Rest Service,然后,如果远程服务使用200 HTTP代码成功返回了响应,则BizTalk可以处理响应消息,但是如果HTTP响应不同于200 BizTalk的代码无法处理故障响应消息.

I have a orchestration which is receive a request from local rest service then send request to another remote Rest Service then if the remote service returns a response successfully with 200 HTTP code BizTalk can be able to process response message, but if HTTP response code different then 200 BizTalk could not process fault response message.

BizTalk日志在事件查看器上给出以下错误.

BizTalk log gives below error on event viewer.

Details:"System.Net.WebException: The remote server returned an unexpected response: (400) Bad Request.
{"errorMessage":{"message":"En az 1 adres alani    gereklidir.","moreInfoURL":"http://paritus.com/kb/api-errors","status":400}}".

此问题之后,我在发送端口上添加了错误操作,但是BizTalk仍然无法捕获失败消息.你有什么主意吗?

After this issue I add a fault operation on send port but BizTalk still could not catch a fail message. Have you got an any idea?

推荐答案

是的,WCF-WebHttp适配器存在问题,因为如果出现故障,它不会设置消息类型上下文属性,因此它不会转到端口上定义的故障"类型.
捕获它的唯一方法是在System.Exception块中.

Yes there is an issue with the WCF-WebHttp adapter in that it does not set the Message Type context property if there is a fault and so it then does not go the the Fault type defined on the port.
The only way to catch it is in a System.Exception block.

请参阅我的博客文章 BizTalk 2013 R2的已知错误,问题和怪癖,错误:BIZTALK WCF-WEBHTTP适配器未在错误时设置消息类型

See my blog post BizTalk 2013 R2 known bugs, issues & quirks, BUG: BIZTALK WCF-WEBHTTP ADAPTER DOES NOT SET MESSAGE TYPE ON ERROR

更新:在CU 5 for BizTalk 2013 R2之后,以下内容不再适用,现在会引发错误.

Update: The below is no longer true after CU 5 for BizTalk 2013 R2, it now throws an error.

还请注意,如果最终系统抛出500状态代码,则根本不会将其作为错误抛出,而您必须自己检查状态代码.

Also please note that if the end systems throws a 500 status code, it is NOT thrown as an error at all and you have to check the status code yourself.

请参见 BizTalk WCF- WebHttp适配器未检测到500错误

这篇关于BizTalk Catch Http响应代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆