URI webServiceEndpointUri = new URI(UnsafeUriCharactersEncoder.encode(remaining));
// Obtain a WebServiceTemplate from the registry when specified by
// an option on the component, else create a new template with
// Spring-WS defaults
WebServiceTemplate webServiceTemplate = resolveAndRemoveReferenceParameter(parameters,
"webServiceTemplate", WebServiceTemplate.class, new WebServiceTemplate());
WebServiceMessageSender messageSender = resolveAndRemoveReferenceParameter(parameters,
"messageSender", WebServiceMessageSender.class, null);
WebServiceMessageFactory messageFactory = resolveAndRemoveReferenceParameter(parameters,
"messageFactory", WebServiceMessageFactory.class, null);
if (webServiceTemplate.getDefaultUri() == null) {
webServiceTemplate.setDefaultUri(webServiceEndpointUri.toString());
}
if (messageSender != null) {
webServiceTemplate.setMessageSender(messageSender);
}
if (messageFactory != null) {
webServiceTemplate.setMessageFactory(messageFactory);
}
configuration.setWebServiceTemplate(webServiceTemplate);
}
}