Spring integration ws:出站网关的全局侦听器

Spring integration ws:出站网关的全局侦听器,spring-integration,spring-ws,Spring Integration,Spring Ws,Spring集成的ws:outbound网关具有拦截器和拦截器属性,允许我为出站springWS定义ClientInterceptor 对于使用springWS的入站web服务,我可以在sws:interceptors中定义一个全局拦截器。我使用它将所有入站请求记录到数据库中 是否有一种方法可以为ALLws:outbound网关实例定义拦截器?我想在所有web服务的数据库中记录出站信息。M-M-M。在这个问题上没有这样一个直接的高级API。 虽然我想我们会使用WebServiceTemplate

Spring集成的ws:outbound网关具有拦截器和拦截器属性,允许我为出站springWS定义ClientInterceptor

对于使用springWS的入站web服务,我可以在sws:interceptors中定义一个全局拦截器。我使用它将所有入站请求记录到数据库中


是否有一种方法可以为ALLws:outbound网关实例定义拦截器?我想在所有web服务的数据库中记录出站信息。

M-M-M。在这个问题上没有这样一个直接的高级API。 虽然我想我们会使用
WebServiceTemplate
注入作为一个点,在任何地方都接受相同的实例。但对于许多
ws:outbound gateway
,它仍然是注入

inbound
部分实际上是基于单个入口点,例如
MessageDispatcherServlet
,但是
outbound
具有不同的入口点,因此无法对其进行全局访问

无论如何,我建议您在配置类中使用一些技巧:

@Autowired
private List<AbstractWebServiceOutboundGateway> outboundWsGateways;

@PostConstruct
public void setup() {
   for (AbstractWebServiceOutboundGateway gateway: this.outboundWsGateways) {
        gateway.setInterceptors(...);
   }

}
@Autowired
私有列表外部网关;
@施工后
公共作废设置(){
for(AbstractWebServiceOutboundGateway:this.outboundWsGateways){
网关.设置拦截器(…);
}
}

M-M-M。在这个问题上没有这样一个直接的高级API。 虽然我想我们会使用
WebServiceTemplate
注入作为一个点,在任何地方都接受相同的实例。但对于许多
ws:outbound gateway
,它仍然是注入

inbound
部分实际上是基于单个入口点,例如
MessageDispatcherServlet
,但是
outbound
具有不同的入口点,因此无法对其进行全局访问

无论如何,我建议您在配置类中使用一些技巧:

@Autowired
private List<AbstractWebServiceOutboundGateway> outboundWsGateways;

@PostConstruct
public void setup() {
   for (AbstractWebServiceOutboundGateway gateway: this.outboundWsGateways) {
        gateway.setInterceptors(...);
   }

}
@Autowired
私有列表外部网关;
@施工后
公共作废设置(){
for(AbstractWebServiceOutboundGateway:this.outboundWsGateways){
网关.设置拦截器(…);
}
}