【问题标题】:Apache Camel CXF set Transport PropertiesApache Camel CXF 设置传输属性
【发布时间】:2020-02-11 14:20:15
【问题描述】:

我正在努力使用 Camel SXF 组件。我需要它使用分块编码,但我没有找到设置参数的正确方法。

根据 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】:

    尝试像这样使用 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) {
    
            }
        });
    

    并且总是指定你的骆驼的版本

    【讨论】:

    • 像魅力一样工作
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多