Apache Camel-接收带有空主体的SOAP响应 [英] Apache Camel - Receiving SOAP response with empty body

查看:97
本文介绍了Apache Camel-接收带有空主体的SOAP响应的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用Apache camel 2.15.3创建的SOAP服务,即使响应SOAP主体有效,一切也可以正常工作.

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

骆驼2.15.3依赖于cxf 3.0.6

Camel 2.15.3 is dependent on cxf 3.0.6

但是当我将cxf-core更新为3.1.3时,一切正常,除了SOAP响应主体为EMPTY.

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.

我缺少一些依赖吗?

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>

推荐答案

我遇到了类似的问题,但是由于Camel 2.16.x中的错误,我不得不继续使用2.15.x.我还必须使用cxf 3.1.1+,因为必须使用CXF中的TLS增强功能.

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.

就我而言,我将cxf maven依赖项(cxf-rt-xxxx)移到了pom文件中的骆驼依赖项之前.同样,由于camel-cxf将引入cxf-core,因此无需显式指定它.这种安排对我很有效(运行骆驼2.15.4和cxf 3.1.3).

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).

这篇关于Apache Camel-接收带有空主体的SOAP响应的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆