使用Camel-CXF

时间:2016-06-16 23:08:52

标签: web-services apache-camel cxf jax-ws jbossfuse

我们正在尝试使用Camel-Cxf / Fuse并使用Payload dataformat调用Soap服务。有时客户端拒绝请求说SOAPAction丢失,这是间歇性的。有没有办法让我们在服务调用期间专门设置SOAPAction?在什么情况下我们无法发送SOAPAction?这是我们用于调用的配置。

<!-- CXF configuration pointing to WSDL URL and service Name -->

    <cxf:cxfEndpoint id="abcSOAPCPOutbound"
                         wsdlURL="wsdl/FooService.wsdl"
                         endpointName="cNS:FooServiceSoap"
                         serviceName="cNS:FooService"
                         address="http://example.com/processRequest.asmx"
                         xmlns:cNS="http://www.example.com"
                         loggingFeatureEnabled="false">
            <cxf:inInterceptors>
                <ref bean="GZIPInInterceptor"/>
            </cxf:inInterceptors>     
            <cxf:outInterceptors>           
                <ref bean="iuABCSOAPOutboundInterceptor"/>        
            </cxf:outInterceptors>       
        </cxf:cxfEndpoint> 

    <!-- Came route for invoking service with operationName header set  -->

    <route id="iuFooOutboundRoute">
                <from uri="direct-vm:iuOutboundtoFoo"/>     
                <setHeader headerName="operationName" >
                    <constant>FooSync</constant>
                </setHeader>
                <convertBodyTo type="String"/> 
                <!-- Send to Colibrium -->
                <to uri="cxf:bean:abcSOAPCPOutbound?dataFormat=PAYLOAD"/> 
        <process ref="extractHTTPStatusCode"/>
    </route>

如果我们在调用服务之前将camel头设置为SOAPAction会导致任何问题吗?

1 个答案:

答案 0 :(得分:0)

是的,

与operationName相同:

<setHeader headerName="SOAPAction">
    <constant>DummyOperation</constant>
</setHeader>

您可以参考此处 - http://www.javaworld.com/article/2078883/open-source-tools/java-tip-write-an-soa-integration-layer-with-apache-camel.html?page=4