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

Default message factory for WebServiceTemplate

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.0 M3
    • Fix Version/s: 1.0 RC1
    • Component/s: Core
    • Labels:
      None

      Description

      MessageDispatcherServlet uses SaajSoapMessageFactory as its message factory by default. This is great, as I only have to configure a message factory if I do not want to use SAAJ.

      I'd like to see the same "sensible default" thinking applied to WebServiceTemplate.

      For the messageFactory property, I'd like it to default to use SaajSoapMessageFactory. This choice makes sense, as it fits most needs and because it's the same default applied on the service side.

      For the messageSender property, the default choice is a bit less clear. CommonsHttpMessageSender is more capable, but HttpUrlConnectionMessageSender is based on HttpUrlConnection which is a given in the JDK and thus requires no additional dependencies. Because it requires no additional dependencies, HttpUrlConnectionMessageSender is a reasonable default for messageSender.

      In either case, if the client developer doesn't want to use the defaults, they can be easily overridden by wiring in a replacement bean. For everyone else, these defaults will cut down a bit on the client-side configuration.

        Activity

        Hide
        arjen.poutsma Arjen Poutsma added a comment -

        I agree about the WebServiceMessageFactory: we can set a default for that.

        The MessageSender is a bit more difficult, though, since that requires an url to send the messages to. We could set the url on the template, and then have some kind of mechanism that determines the correct MessageSender based on the url (i.e. http urls take the HttpUrlConnection one, jms urls take the JMS message sender, etc).

        Show
        arjen.poutsma Arjen Poutsma added a comment - I agree about the WebServiceMessageFactory: we can set a default for that. The MessageSender is a bit more difficult, though, since that requires an url to send the messages to. We could set the url on the template, and then have some kind of mechanism that determines the correct MessageSender based on the url (i.e. http urls take the HttpUrlConnection one, jms urls take the JMS message sender, etc).
        Hide
        habuma Craig Walls added a comment -

        Ah...you're right about MessageSender. I wasn't thinking about that in the late hours that I wrote up this issue. And, as you pointed out, it gets trickier when you consider that it might not be HTTP.

        I'm okay with dropping that portion of this issue...but still like the idea of a default message factory.

        Show
        habuma Craig Walls added a comment - Ah...you're right about MessageSender. I wasn't thinking about that in the late hours that I wrote up this issue. And, as you pointed out, it gets trickier when you consider that it might not be HTTP. I'm okay with dropping that portion of this issue...but still like the idea of a default message factory.
        Hide
        arjen.poutsma Arjen Poutsma added a comment -

        Closing RC1 issues.

        Show
        arjen.poutsma Arjen Poutsma added a comment - Closing RC1 issues.

          People

          • Assignee:
            arjen.poutsma Arjen Poutsma
            Reporter:
            habuma Craig Walls
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: