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

查看:41
本文介绍了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.

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

我是否缺少一些依赖项?

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>

推荐答案

我遇到了类似的问题,但是由于 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,因此无需明确指定它.这种安排对我有用(运行 camel 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天全站免登陆