在发送一些额外属性时使用CXF和Spring Java Config解组错误(但在使用XML配置时没有错误)

问题描述 投票:0回答:1

我有一些奇怪的问题。

我们有一个WSDL并从中生成了JAXB代码。该服务的第一次部署是使用Spring XML配置,我们将端点配置为

<jaxws:endpoint id="paymentProcess"
    implementor="com.path.implementation.class"
    address="/paymentProcess"/>

在不知不觉中,客户端系统向其中一个Web方法请求添加了一个属性(xml元素),但此代码中没有任何内容。它忽略了额外的财产。

但现在我已经使用JavaConfig更改了代码

@Bean("cxf")
public SpringBus springBus() {
    System.setProperty("org.apache.cxf.logging.enabled", "pretty");
    return new SpringBus();
}

@Bean
public Endpoint paymentServiceEndpoint(InstallmentServicesImpl installmentServices) {
    EndpointImpl endpoint = new EndpointImpl(springBus(), installmentServices);
    endpoint.publish("/paymentProcess");
    return endpoint;
}

在这个更改之后,我们遇到了很多问题,经过大量的努力,我们发现客户端发送了一个额外的属性(一个xml元素),这个属性不在初始的WSDL中,并且因为发生了解组错误。

有什么办法可以让CXF忽略这些额外的元素吗?

java spring web-services cxf spring-java-config
1个回答
0
投票

问题在于我的JDK和CXFversions,目标系统部署在JDK 6上,这使我将CXF降级到版本3.0。一切都很顺利。

© www.soinside.com 2019 - 2024. All rights reserved.