Affects Version/s: None
Fix Version/s: None
Spring-WS Client can use several transports for SOAP interaction: HTTP, JMS, Email and XMPP. WebServiceTemplate selects WebServiceMessageSender by some specific URI scheme indicator: jms, mailto, xmpp. It works OK, when we use Spring-WS Client API directly and our URIs are hardcoded. But when we want to use somehow before WebServiceTemplate invocation org.springframework.web.util.UriTemplate we end up with transport specific destination which is prepended with "/": e.g.
the result of XmppTransportUtils#getTo() for URI 'xmpp:firstname.lastname@example.org' after UriTemplate will be '/email@example.com'.
It happens, because UriTemplate identifies 'to' part as a 'path' and the last one in the UriComponents#toUriString() will be prepended with UriComponents#PATH_DELIMITER.
So, it will be great, if transport specific URIs will be standardized like: http://, ftp://, file:// etc. In this case UriTemplate works as expected. E.g. for email: 'mailto://firstname.lastname@example.org?subject=Test subject':
queryParams: subject=Test subject
It works right now, but in the end MailTransportUtils.getTo() rosolves to '//email@example.com'.
At a glance it will be enough to improve destination's patterns in JmsTransportUtils, MailTransportUtils and XmppTransportUtils to get the right piece of the uri.getSchemeSpecificPart().
The solution is here UriComponentsBuilder#USERINFO_PATTERN and UriComponentsBuilder#HOST_PATTERN.
In addition: changes just only on patterns won't break backward compatibility.