Apache Camel CXF set传输属性

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

我正在与Camel SXF组件斗争。我需要它not使用分块编码,但是我找不到设置参数的正确方法。

根据Apache CXF Docs(http://cxf.apache.org/docs/client-http-transport-including-ssl-support.html),应该有一个名为“ AllowChunking”的参数,但是尝试使用它时我没有运气。我尝试过此

.to("cxf:bean:pdsEndpointBean?loggingFeatureEnabled=true&properties.AllowChunking=false")

和此

    @Bean
    public CxfEndpoint pdsEndpointBean() {
        CxfEndpoint cxfEndpoint = new CxfEndpoint();
        cxfEndpoint.setAddress(endpoint);
        cxfEndpoint.setEndpointName("foo");
        cxfEndpoint.setWsdlURL("bar");
        cxfEndpoint.setServiceClass(foo);
        HashMap<String, Object> properties = new HashMap<>();
        properties.put("AllowChunking",false);
        cxfEndpoint.setProperties(properties);
        return cxfEndpoint;
    }

有人可以帮我吗?非常感谢:)

使用骆驼3.0.1

spring-boot soap apache-camel cxf camel-cxf
1个回答
1
投票

尝试像这样使用CxfEndpointConfigurer:

  cxfEndpoint.setCxfEndpointConfigurer(new CxfEndpointConfigurer() {
        @Override
        public void configure(final AbstractWSDLBasedEndpointFactory abstractWSDLBasedEndpointFactory) {

        }

        @Override
        public void configureClient(final Client client) {
            ((HTTPConduit)client.getConduit()).getClient().setAllowChunking(false);
        }

        @Override
        public void configureServer(final Server server) {

        }
    });

并始终指定骆驼的版本

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