【发布时间】:2013-08-14 15:09:07
【问题描述】:
我正在使用 camel 和 cxf 组件从 Web 服务获取一些数据。在某些情况下,Web 服务会返回标准的 soap:fault。 我有接下来的步骤:
<camel:route id="someId">
<camel:onException useOriginalMessage="false">
<camel:exception>java.lang.Exception</camel:exception>
<camel:handled>
<camel:constant>false</camel:constant>
</camel:handled>
<camel:process ref="defaultNaoIntegrationErrorHandler" />
<camel:to uri="ref:naointegration.checkAvailability.jms.error.queue" />
</camel:onException>
<camel:from uri="direct:naoCheckAvailabilityOut" />
<camel:marshal ref="soapjaxbSAP" />
<camel:to id="naoCheckAvailabilityEndpoint" uri="cxf:bean:naoCheckAvailabilityEndpoint" />
<camel:unmarshal ref="soapjaxbSAP" />
</camel:route>
naoCheckAvailabilityEndpoint 在哪里:
<cxf:cxfEndpoint id="naoCheckAvailabilityEndpoint"
address="${naointegration.I011.CheckAvailability.soap.address}"
endpointName="s:checkAvailabilityEndpoint" serviceName="s:SOAPService"
xmlns:s="http://www.example.com/test">
<cxf:properties>
<entry key="dataFormat" value="MESSAGE" />
<entry key="setDefaultBus" value="true" />
</cxf:properties>
<cxf:outInterceptors>
<ref bean="logOutbound" />
</cxf:outInterceptors>
<cxf:inFaultInterceptors>
<ref bean="logOutbound" />
</cxf:inFaultInterceptors>
</cxf:cxfEndpoint>
如果我收到正常的肥皂信息,一切正常。当我得到soap foalt / http 500时,我只有字符串消息,其中包含带有soap错误的soap消息(xml)。
在类似问题上阅读 cxf 和 camel 邮件列表我理解 cxf 端点应该抛出异常,如果有肥皂泡沫,类型为 org.apache.cxf.binding.soap.SoapFault 的异常,但我无法得到它。 目标是 onException 子句对soap错误异常进行处理。
有什么建议吗?
【问题讨论】:
标签: java soap cxf apache-camel