OSB - 在代理服务中处理来自 Restful 服务的 Http 错误

OSB - Processing Http errors from Restful service in Proxy Service

我正在从 OSB 代理服务调用 REST 服务,如果其余服务响应是有效响应,即没有错误,则该服务工作正常。但是,如果其余服务回复了一个 http 错误代码(例如 400 Bad Request),我将无法捕获除 http 错误代码之外的任何其他内容:

OSB 中的 $fault 变量:

<con:fault  xmlns:con="http://www.bea.com/wli/sb/context">
<con:errorCode>BEA-382502</con:errorCode>
<con:reason>
OSB Service Callout action received an error response
</con:reason>
<con:details>
<con1:ErrorResponseDetail   xmlns:con1="http://www.bea.com/wli/sb/stages/transform/config">
<con1:http-response-code>400</con1:http-response-code>
</con1:ErrorResponseDetail>
</con:details>
<con:location>
<con:node>PipelinePairNode1</con:node>
<con:pipeline>PipelinePairNode1_request</con:pipeline>
<con:stage>stage1</con:stage>
<con:path>request-pipeline</con:path>
</con:location>
</con:fault>

但是其余的服务,不仅回复了 400 Bad Request,还添加了一条消息:

 <Error>
    <Message>The message header contains an invalid brand code.</Message>
 </Error>

我无法在我的代理服务中处理。有谁知道是否可以在 OSB 中访问此消息的详细信息,或者这是一个限制?

rest 服务显然在发送消息,因为直接通过 soap-ui 调用它会得到以下响应:

 HTTP/1.1 400 Bad Request
 Cache-Control: no-cache
 Pragma: no-cache
 Content-Length: 84
 Content-Type: application/xml; charset=utf-8
 Expires: -1
 Server: Microsoft-IIS/8.5
 X-AspNet-Version: 4.0.30319
 X-Powered-By: ASP.NET
 Date: Mon, 09 Feb 2015 16:15:32 GMT


 <Error><Message>The message header contains an invalid brand code.</Message></Error>

谢谢

如果我理解你的问题,你想得到除http代码之外的消息错误?

我认为您应该在消息流中使用 errorHandler ,以便您可以捕获错误并执行任何您想做的事情。

我刚刚发现这是一个 OSB 错误,如果返回 HTTP 错误代码 400,如果 http-content 是 "Application/XML",则消息将被忽略。

Oracle在上个月底发布了一个补丁来解决这个问题,我已经测试过了并且可以使用。我现在可以在 $body 变量中获取消息详细信息。

补丁:16986497

代理服务操作选择算法无法从请求中确定操作名称或returns无效操作(不在 WSDL 中或为空的操作)。可能的原因包括:

计算运算时出错。

操作选择算法returns null.

操作选择算法returns一个不属于 WSDL 声明的操作的操作。

Source