Source:
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(); if (this.circuitBreaker != null) { 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; }

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; }