Apache Camel - Receiving SOAP response with empty body

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-24 13:33:55

问题


Created SOAP service using Apache camel 2.15.3 and everything works fine, even the response SOAP body is valid.

Camel 2.15.3 is dependent on cxf 3.0.6

But when i updated cxf-core to 3.1.3, everything works fine, except the SOAP response body is EMPTY.

There is no error logs, and the server starts up normally.

am i missing some dependencies ?

POM.xml

<properties>
        <log4j.version>1.2.17</log4j.version>
        <camel.version>2.15.3</camel.version>
        <spring.version>4.1.6.RELEASE</spring.version>
        <cxf.version>3.1.3</cxf.version>
    </properties>
    <dependencies>
        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <version>${log4j.version}</version>

        </dependency>
        <!-- Camel dependencies -->
        <dependency>
            <groupId>org.apache.camel</groupId>
            <artifactId>camel-core</artifactId>
            <version>${camel.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.camel</groupId>
            <artifactId>camel-cxf</artifactId>
            <version>${camel.version}</version>
        </dependency>

        <!-- Spring dependencies -->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-web</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-core</artifactId>
            <version>${spring.version}</version>
        </dependency>

        <!-- CXF -->
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-core</artifactId>
            <version>${cxf.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-frontend-jaxws</artifactId>
            <version>${cxf.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-frontend-jaxrs</artifactId>
            <version>${cxf.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-transports-http</artifactId>
            <version>${cxf.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-rs-service-description</artifactId>
            <version>${cxf.version}</version>
        </dependency>

回答1:


I ran into a similar problem but because of a bug in Camel 2.16.x, I have to stay with 2.15.x. I also must use cxf 3.1.1+ because of a TLS enhancement in CXF that I must use.

In my case, I moved my cxf maven dependency (cxf-rt-xxxx) ahead of camel dependencies in the pom file. Also since camel-cxf will bring in cxf-core, there is no need to specify it explicitly. This arrangement worked for me (running camel 2.15.4 and cxf 3.1.3).




回答2:


If we are using camel-cxf 2.15.3 then we have to cxf-rt-bindings-soap, cxf-rt-features-clustering, cxf-rt-frontend-jaxrs, cxf-rt-frontend-jaxws, cxf-rt-rs-security-oauth (3.0.6). all these cxf-rt-* jars depends on cxf-core 3.0.6 . That's why it is always better to use apache camel 2.15.3 with cxf-core 3.0.6. If you want to use cxf-core to 3.1.3 use camel 2.16.0(which is latest) it should work you can give a try. FYI: apache camel 2.16.0 supports cxf-core to 3.1.2



来源:https://stackoverflow.com/questions/33409667/apache-camel-receiving-soap-response-with-empty-body

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!