final ClientHttpRequestMessageSender clientHttpRequestMessageSender = new ClientHttpRequestMessageSender();
final SimpleClientHttpRequestFactory requestFactory = new SimpleClientHttpRequestFactory();
Jaxb2Marshaller jaxb2Marshaller = new Jaxb2Marshaller();
jaxb2Marshaller.setContextPath(transunionProperties.getContextPath());
Map<String, Object> map = new HashMap<>();
map.put("jaxb.formatted.output", true);
map.put(Marshaller.JAXB_ENCODING, "UTF-8");
map.put(CharacterEscapeHandler.class.getName(), NoEscapeHandler.theInstance);
jaxb2Marshaller.setMarshallerProperties(map);
requestFactory.setReadTimeout(transunionProperties.getReadTimeout());
requestFactory.setConnectTimeout(transunionProperties.getConnectionTimeout());
clientHttpRequestMessageSender.setRequestFactory(requestFactory);
return new WebServiceTemplateBuilder()
.setDefaultUri(HARNESS_ENDPOINT)
.setMarshaller(jaxb2Marshaller)
.setUnmarshaller(jaxb2Marshaller)
.setCheckConnectionForFault(true)
.interceptors(new TransunionClientInterceptor())
.messageSenders(clientHttpRequestMessageSender)
.build();
**This is the WebServiceTemplate configuration
When I use the same configuration for Jaxb2Marshaller and marshall my object it works but if I call the marshalSendAndRecieve method it does not use my caracterEscapeHandler**
Comment From: poutsma
WebServiceTemplate
is a Spring-WS class, not Spring Framework. Please file an issue here.