我有一個關於Mule 3.3.1 CE中的Web服務的問題。我有一個Web服務公開了三個操作和一個實現這些操作的類。這些操作可以返回結果(肯定)或異常(AuthExeception,ValidateExeception等)。 感謝SOAP Mule組件,當我提出Java異常時,框架能夠在SOAP Fault中編組java異常,但是如果我想要將SOAP Fault返回給客戶端,並使用Mule中的異常策略處理異常(即發送電子郵件),騾的行爲,這不是我能指望的。 換句話說,當我舉起一個AuthException時,流控制會傳遞給定義的異常策略,並且我不再能夠將SOAP Fault(AuthException)發送回客戶端。如何處理Mule中的SOAP Web服務中的異常策略
問題是:我怎樣才能發回SOAP響應並處理異常策略?
這裏下面則存在例外策略與記錄器組件簡單地實現騾子xml文件的一個片段:
<flow name="esb_consignmentFlow1" doc:name="esb_consignmentFlow1">
<http:inbound-endpoint exchange-pattern="request-response" host="${conn.host}" port="8081" doc:name="HTTP" path="sgb/consignment" />
<cxf:jaxws-service doc:name="Process SOAP Request" serviceClass="com.suzuki.sales.webservice.ProcessTriggerPortType"/>
<component class="it.aizoon.suzuki.service.implementation.TriggerConsignmentOperationsImplementation" doc:name="triggerConsignmentOperationsImpl"/>
<catch-exception-strategy doc:name="Catch Exception Strategy">
<flow-ref name="ErrorHandling" doc:name="Flow Reference"/>
</catch-exception-strategy>
</flow>
<flow name="ErrorHandling" doc:name="ErrorHandling" >
<logger level="INFO" doc:name="Logger"/>
</flow>
我讀過一些關於處理策略,但我不知道這是否是正確的方法。 非常感謝您的幫助。
這裏是我的解決方案 –