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

WebServiceTemplate(Marshaller marshaller) constructor doesn't call initDefaultStrategies()

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.1.4
    • Component/s: None
    • Labels:
      None

      Description

      I noticed this morning that when creating a new WebServiceTemplate using the default no arg constructor, the behaviour is different compared to using the constructor that accepts a Marshaller arg. The constructor with the Marshaller arg doesn't call the initDefaultStrategies() method, and therefore calling methods on the template throws exceptions that you don't get if using the no arg constructor and just call the setMarshaller() and setUnmarshaller() methods.

      Here's the 2 constructors source:

      public WebServiceTemplate() {
          initDefaultStrategies();
      }
       
      public WebServiceTemplate(Marshaller marshaller) {
          Assert.notNull(marshaller, "marshaller must not be null");
          if (!(marshaller instanceof Unmarshaller)) {
              throw new IllegalArgumentException("Marshaller [" + marshaller + "] does not implement the Unmarshaller " +
                      "interface. Please set an Unmarshaller explicitly by using the " +
                      "WebServiceTemplate(Marshaller, Unmarshaller) constructor.");
          }
          else {
              this.setMarshaller(marshaller);
              this.setUnmarshaller((Unmarshaller) marshaller);
          }
      }

        Activity

        pgrimard Patrick Grimard created issue -
        arjen.poutsma Arjen Poutsma made changes -
        Field Original Value New Value
        Assignee Arjen Poutsma [ arjen.poutsma ]
        arjen.poutsma Arjen Poutsma made changes -
        Fix Version/s 2.1.4 [ 14119 ]
        arjen.poutsma Arjen Poutsma made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        arjen.poutsma Arjen Poutsma made changes -
        Status In Progress [ 3 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open In Progress In Progress
        16d 21h 51m 1 Arjen Poutsma 19/Aug/13 4:19 AM
        In Progress In Progress Resolved Resolved
        6m 57s 1 Arjen Poutsma 19/Aug/13 4:26 AM

          People

          • Assignee:
            arjen.poutsma Arjen Poutsma
            Reporter:
            pgrimard Patrick Grimard
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: