WebServiceTemplate webServiceTemplate = configuration.getWebServiceTemplate();
WebServiceMessageSender[] messageSenders = webServiceTemplate.getMessageSenders();
for (int i = 0; i < messageSenders.length; i++) {
WebServiceMessageSender messageSender = messageSenders[i];
if (messageSender instanceof CommonsHttpMessageSender) {
if (configuration.getSslContextParameters() != null) {
LOG.warn("Not applying SSLContextParameters based configuration to CommonsHttpMessageSender. "
+ "If you are using this MessageSender, which you are not by default, you will need "
+ "to configure SSL using the Commons HTTP 3.x Protocol registry.");
}
if (configuration.getTimeout() > -1) {
if (messageSender.getClass().equals(CommonsHttpMessageSender.class)) {
((CommonsHttpMessageSender) messageSender).setReadTimeout(configuration.getTimeout());
} else {
LOG.warn("Not applying timeout configuration to CommonsHttpMessageSender based implementation. "
+ "You are using what appears to be a custom MessageSender, which you are not doing by default. "
+ "You will need configure timeout on your own.");
}
}
} else if (messageSender.getClass().equals(HttpUrlConnectionMessageSender.class)) {
// Only if exact match denoting likely use of default configuration. We don't want to get
// sub-classes that might have been otherwise injected.
messageSenders[i] = new AbstractHttpWebServiceMessageSenderDecorator((HttpUrlConnectionMessageSender) messageSender, configuration);
} else {
// For example this will be the case during unit-testing with the net.javacrumbs.spring-ws-test API