org.springframework.ws.client.support.interceptor.ClientInterceptor Java Examples

The following examples show how to use org.springframework.ws.client.support.interceptor.ClientInterceptor. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: TraceeSpringWsConfiguration.java    From tracee with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
@Override
public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
	if (bean instanceof WebServiceTemplate) {
		final WebServiceTemplate webServiceTemplate = (WebServiceTemplate)bean;
		final ClientInterceptor[] interceptors = webServiceTemplate.getInterceptors();
		final ClientInterceptor[] newInterceptors;
		if (interceptors != null) {
			newInterceptors = Arrays.copyOf(interceptors, interceptors.length+1);
		} else {
			newInterceptors = new ClientInterceptor[1];
		}
		newInterceptors[newInterceptors.length-1] = interceptor;
		webServiceTemplate.setInterceptors(newInterceptors);
	}
	return bean;
}
 
Example #2
Source File: StandardXRoadConsumer.java    From j-road with Apache License 2.0 5 votes vote down vote up
@Override
protected void initGateway() throws Exception {
  metadata = XmlBeansUtil.loadMetadata();

  Collection<ClientInterceptor> interceptors = createInterceptors();
  if (interceptors != null && !interceptors.isEmpty()) {
    setInterceptors(interceptors.toArray(new ClientInterceptor[0]));
  }
  getWebServiceTemplate().setCheckConnectionForFault(false);
}
 
Example #3
Source File: StandardXRoadConsumer.java    From j-road with Apache License 2.0 4 votes vote down vote up
protected Collection<ClientInterceptor> createInterceptors() {
  return Arrays.asList(new ClientInterceptor[] { new WSConsumptionLoggingInterceptor() });
}
 
Example #4
Source File: TraceeSpringWsConfigurationTest.java    From tracee with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
@Test
public void webServiceTemplatePostProcessorAddsTraceeClientInterceptorToWebServiceTemplateInterceptors() {
	unit.postProcessBeforeInitialization(webServiceTemplate, "");
	Assert.assertThat(webServiceTemplate.getInterceptors(), Matchers.arrayContaining((ClientInterceptor)traceeClientInterceptor));
}
 
Example #5
Source File: SimulatorWebServiceClientConfigurer.java    From citrus-simulator with Apache License 2.0 2 votes vote down vote up
/**
 * Gets the list of client interceptors.
 *
 * @return
 */
ClientInterceptor[] interceptors();