[SWS-844] WebServiceTemplate(Marshaller marshaller) constructor doesn't call initDefaultStrategies() Created: 02/Aug/13  Updated: 19/Aug/13  Resolved: 19/Aug/13

Status: Resolved
Project: Spring Web Services
Component/s: None
Affects Version/s: None
Fix Version/s: 2.1.4

Type: Bug Priority: Minor
Reporter: Patrick Grimard Assignee: Arjen Poutsma
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


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() {

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.setUnmarshaller((Unmarshaller) marshaller);

Generated at Wed Nov 14 00:40:03 UTC 2018 using JIRA 7.9.2#79002-sha1:3bb15b68ecd99a30eb364c4c1a393359bcad6278.