Source:
<code>private WebServiceTemplate createTemplate(final String organisationIdentification, final String userName, final String applicationName) throws WebServiceSecurityException { final WebServiceTemplate webServiceTemplate = new WebServiceTemplate(this.messageFactory); webServiceTemplate.setCheckConnectionForFault(true); if (this.targetUri != null) { webServiceTemplate.setDefaultUri(this.targetUri); if (this.targetUri.contains(PROXY_SERVER)) { webServiceTemplate.setCheckConnectionForFault(false); } } webServiceTemplate.setMarshaller(this.marshaller); webServiceTemplate.setUnmarshaller(this.marshaller); final ClientInterceptor organisationIdentificationClientInterceptor = OrganisationIdentificationClientInterceptor .newBuilder().withOrganisationIdentification(organisationIdentification).withUserName(userName) .withApplicationName(applicationName).build(); <START> if (this.circuitBreaker != null) { <END> final ClientInterceptor circuitBreakerInterceptor = new CircuitBreakerInterceptor(this.circuitBreaker); webServiceTemplate.setInterceptors( new ClientInterceptor[] { circuitBreakerInterceptor, organisationIdentificationClientInterceptor }); } else { webServiceTemplate.setInterceptors(new ClientInterceptor[] { organisationIdentificationClientInterceptor }); } if (this.isSecurityEnabled) { try { webServiceTemplate.setMessageSender(this.webServiceMessageSender(organisationIdentification)); } catch (GeneralSecurityException | IOException e) { LOGGER.error("Webservice exception occurred: Certificate not available", e); throw new WebServiceSecurityException("Certificate not available", e); } } else { webServiceTemplate.setMessageSender(this.webServiceMessageSender()); } return webServiceTemplate; }</code><technical_language>A more extensible solution a set - LinkedHashSet<ClientInterceptor> - in end call webServiceTemplate.setInterceptors(interceptorSet.ToArray(new ClientInterceptor[interceptorSet.size()]); UPDATE: interceptors needed more once, a List in stead of a Set</technical_language>

Target:
private WebServiceTemplate createTemplate(final String organisationIdentification, final String userName, final String applicationName) throws WebServiceSecurityException { final WebServiceTemplate webServiceTemplate = new WebServiceTemplate(this.messageFactory); webServiceTemplate.setCheckConnectionForFault(true); if (this.targetUri != null) { webServiceTemplate.setDefaultUri(this.targetUri); if (this.targetUri.contains(PROXY_SERVER)) { webServiceTemplate.setCheckConnectionForFault(false); } } webServiceTemplate.setMarshaller(this.marshaller); webServiceTemplate.setUnmarshaller(this.marshaller); final ClientInterceptor organisationIdentificationClientInterceptor = OrganisationIdentificationClientInterceptor .newBuilder().withOrganisationIdentification(organisationIdentification).withUserName(userName) .withApplicationName(applicationName).build(); final List<ClientInterceptor> interceptors = new ArrayList<>(); interceptors.add(organisationIdentificationClientInterceptor); if (this.circuitBreaker != null) { final ClientInterceptor circuitBreakerInterceptor = new CircuitBreakerInterceptor(this.circuitBreaker); interceptors.add(circuitBreakerInterceptor); } webServiceTemplate.setInterceptors(interceptors.toArray(new ClientInterceptor[interceptors.size()])); if (this.isSecurityEnabled) { try { webServiceTemplate.setMessageSender(this.webServiceMessageSender(organisationIdentification)); } catch (GeneralSecurityException | IOException e) { LOGGER.error("Webservice exception occurred: Certificate not available", e); throw new WebServiceSecurityException("Certificate not available", e); } } else { webServiceTemplate.setMessageSender(this.webServiceMessageSender()); } return webServiceTemplate; }