Biztalk编排请求-响应异常处理
我有一个编排,它使用请求响应端口来调用 Web 服务并等待响应。 这工作得很好。
我现在正在做测试来处理错误,并且我正在调用一个抛出除零异常的 Web 服务。 编排不会将异常捕获为异常;它的作用就好像我返回的 SOAP 错误是一个常规字符串。
然而,当我仅使用请求端口测试此行为时,我最终陷入了编排的 catch 块中,并出现除以零异常。 我需要在请求响应端口中捕获 Web 服务异常,而不仅仅是在单向端口上。
I have an orchestration that uses a request response port to call to a web service and wait for a response.
This is working perfectly.
I am now doing tests to handle errors and I am calling a web service that throws a divide by zero exception.
The orchestration doesn't catch the exception as an exception; it acts as if the SOAP fault I am getting back is a regular string.
However when I tested this behavior with only a request port, I ended up within the catch block of the orchestration with the divide by zero exception.
I need to catch the web service exception also in the request response ports and not only on the one way port.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您看到的此类错误是因为来自 Web 服务的 HTTP 响应存在问题。 BizTalk 尝试解析收到的响应并将其分解为标头和正文,然后解析标头。如果响应是格式错误的 HTTP,则会导致此类错误。它使用 SOAP 库来解释响应消息,但由于消息错误而导致崩溃。除数为零的情况可能会发生,因为它无法准确地从标头获取响应长度,然后进行了一些数学计算。
我会在线路上放置一个数据包嗅探器(例如 NetMon),然后查看实际发送到 BizTalk 的内容。如果它不符合 HTTP(浏览规范或为傻瓜找到一个好的 HTTP),BizTalk 可能会做出不可预测的反应。
祝你好运。
This type of error you are seeing is because there is a problem with the HTTP response coming from the web service. BizTalk tries to parse the received response and break it up into header and body and then parse the header. If the response is malformed HTTP, it causes this kind of error. It's using the SOAP librbary to interpret the response message and it blows up becuase the message is bad. The divide by zero may happen because it couldn't accurately get the response length form the header and then scrogged some math.
I would place a packet sniffer on the line (like NetMon) and see what is actually being sent to BizTalk. If it's not HTTP compliant (browse the spec or find a good HTTP for dummies), BizTalk can react un predictably.
Best of luck.
首先你得遵守规则!
为了在使用请求响应端口时捕获 Biztalk 范围块内的异常,您可能必须执行以下操作...
希望这有帮助。
参考资料: 看看我在代码项目中的文章
代码项目
Your have to play by the rules first!
In order to catch an exception within your scope block in Biztalk while using a request-response port, you might have to do the following...
Hope this helps.
References: Have a look at my article in code project
Code Project