diff --git a/core/src/main/java/org/springframework/ws/server/endpoint/AbstractMarshallingPayloadEndpoint.java b/core/src/main/java/org/springframework/ws/server/endpoint/AbstractMarshallingPayloadEndpoint.java
index 53bc0812..aa498712 100644
--- a/core/src/main/java/org/springframework/ws/server/endpoint/AbstractMarshallingPayloadEndpoint.java
+++ b/core/src/main/java/org/springframework/ws/server/endpoint/AbstractMarshallingPayloadEndpoint.java
@@ -64,6 +64,30 @@ public abstract class AbstractMarshallingPayloadEndpoint implements MessageEndpo
protected AbstractMarshallingPayloadEndpoint() {
}
+ /**
+ * Creates a new AbstractMarshallingPayloadEndpoint with the given marshaller. If the given {@link
+ * Marshaller} also implements the {@link Unmarshaller} interface, it is used for both marshalling and
+ * unmarshalling. Otherwise, an exception is thrown.
+ *
marshaller does not implement the {@link Unmarshaller}
+ * interface
+ */
+ protected AbstractMarshallingPayloadEndpoint(Marshaller marshaller) {
+ if (!(marshaller instanceof Unmarshaller)) {
+ throw new IllegalArgumentException("Marshaller [" + marshaller + "] does not implement the Unmarshaller " +
+ "interface. Please set an Unmarshaller explicitely by using the " +
+ "AbstractMarshallingPayloadEndpoint(Marshaller, Unmarshaller) constructor.");
+ }
+ else {
+ this.marshaller = marshaller;
+ this.unmarshaller = (Unmarshaller) marshaller;
+ }
+ }
+
/**
* Creates a new AbstractMarshallingPayloadEndpoint with the given marshaller and unmarshaller.
*