Uploaded image for project: 'Spring Web Services'
  1. Spring Web Services
  2. SWS-795

Allow for MessageSenders to use URI as result of UriTemplate

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Deferred
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Core
    • Labels:
      None

      Description

      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:user@jabber.org' after UriTemplate will be '/user@jabber.org'.
      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://user@example.com?subject=Test subject':
      scheme: mailto
      userInfo: user
      host: example.com
      queryParams: subject=Test subject
      It works right now, but in the end MailTransportUtils.getTo() rosolves to '//user@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.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              arjen.poutsma Arjen Poutsma
              Reporter:
              abilan Artem Bilan
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: