2013-09-26 75 views
0

我定义了一个流程。它用CXF发布一个Web服务,交换模式:请求 - 响应。该服务定义/抛出异常类型:CAEService_Exception。 Web服务的实现几乎是一个虚拟的。 ws请求由流中的其他消息处理器处理。在流程中,其他组件或ESB本身可能会抛出不同的例外,例如ConnectionException,ApplicatOneException或CompnentTwoException永远是什么。 在这种情况下,仅向客户端抛出(业务异常)CAEService_Exception非常重要! 如何获取(捕获)不同的异常,以及如何处理/处理它们,以便CXF模块将CAEService_Exception抛出到客户端?转换/转换异常类型

感谢您的咨询! 问候 Dianlong

<flow name="CAEService" doc:name="CAEService"> 
    <http:inbound-endpoint address="${http.host.inbound}/ebiz/ws/CAEService" exchange-pattern="request-response" doc:name="HTTP"> 
     <cxf:simple-service serviceClass="org.mule.j2a.ws.cae.CAEService"/> 
    </http:inbound-endpoint> 
    <component class="org.mule.j2a.ws.cae.CAEServiceImpl" doc:name="Java"/> 
    <flow-ref name="Fest_ERPs" doc:name="Sub Flow with transformers, call other services, etc."/> 

    <!-- exceptions --> 

</flow> 

回答

0

您可以使用选择的异常策略搭上不同的。

<flow name="Sample_Flow"> 
... 
<choice-exception-strategy doc:name="Choice Exception Strategy"> 
    <catch-exception-strategy doc:name="Catch Exception Strategy"/> 
    <rollback-exception-strategy doc:name="Rollback Exception Strategy"/> 
</choice-exception-strategy> 
</flow> 

,然后扔东西别的客户那里respecive implementatinos

<catch-exception-strategy name="Catch_Exception_Strategy"> 
    -- do you stuff 
</catch-exception-strategy>