繁体   English   中英

camel cxf客户端肥皂故障处理

[英]camel cxf client soap fault handling

我正在使用camel和cxf组件从web服务获取一些数据。 在某些情况下,web-service返回标准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>

如果我得到正常的肥皂信息一切都好。 当我得到肥皂foalt / http 500我只有字符串消息,其中包含肥皂消息(xml)与肥皂错误。

阅读cxf和camel邮件列表上的类似问题我理解cxf端点应该抛出异常,如果有soap foalt,类型为org.apache.cxf.binding.soap.SoapFault的异常,但我无法得到它。 目标是onException子句来处理soap fault异常。

有什么建议么?

您正在使用MESSAGE数据格式,这意味着camel-cxf端点只是从传输中传递流,它不会读取下层消息,因此camel-cxf端点无法分辨哪条消息是正常的soap消息还是soap故障消息。

如果你想让camel路由处理soap故障,你需要使用PAYLOAD或POJO数据格式。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM