【问题标题】:Spring Integration support for non-conforming servicesSpring Integration 对不合格服务的支持
【发布时间】:2014-11-17 15:42:41
【问题描述】:

Spring-WS 提供以下支持作为其模板的一部分。

http://docs.spring.io/spring-ws/site/apidocs/org/springframework/ws/client/core/WebServiceTemplate.html#setCheckConnectionForFault(boolean)

试图确定 Spring Integration 是否公开了这一点。从 2012 年找到以下内容,但我希望它会成为框架的一部分。

http://forum.spring.io/forum/spring-projects/integration/119981-ws-outbound-gateway-and-soap-fault

【问题讨论】:

    标签: spring-integration


    【解决方案1】:

    不,我们还不支持。

    正如我所说的:随时提出 JIRA 问题! :-)

    【讨论】:

    • 感谢您的快速回复:)
    【解决方案2】:

    基于 2012 链接的解释的示例配置 ...

    @Bean
    @Description("Workaround for non conforming services")
    AbstractWebServiceOutboundGateway initializeWebserviceGateway(
            @Qualifier("wsOutboundGateway.handler") Object bean) {
    
        Advised advised = (Advised) bean;
    
        AbstractWebServiceOutboundGateway gateway = null;
        try {
            gateway = (AbstractWebServiceOutboundGateway) advised
                    .getTargetSource().getTarget();
        } catch (Exception e) {
            throw new IllegalStateException("Unable to configure webServiceTemplate for non conforming services");
        } 
    
        DirectFieldAccessor dfa = new DirectFieldAccessor(gateway);
        WebServiceTemplate wst = (WebServiceTemplate) dfa
                .getPropertyValue("webServiceTemplate");
        wst.setCheckConnectionForError(false);
        wst.setCheckConnectionForFault(false);
    
        return gateway;
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-08-27
      • 1970-01-01
      • 2015-07-26
      • 2021-10-19
      • 1970-01-01
      相关资源
      最近更新 更多