diff --git a/org.springframework.integration.ws/src/main/java/org/springframework/integration/ws/handler/SimpleWebServiceHandler.java b/org.springframework.integration.ws/src/main/java/org/springframework/integration/ws/handler/SimpleWebServiceHandler.java index 0d7305c156..f8e6fdbdbd 100644 --- a/org.springframework.integration.ws/src/main/java/org/springframework/integration/ws/handler/SimpleWebServiceHandler.java +++ b/org.springframework.integration.ws/src/main/java/org/springframework/integration/ws/handler/SimpleWebServiceHandler.java @@ -31,6 +31,7 @@ import org.springframework.ws.client.core.WebServiceMessageCallback; import org.springframework.xml.transform.StringResult; import org.springframework.xml.transform.StringSource; import org.springframework.xml.transform.TransformerObjectSupport; +import org.w3c.dom.Document; /** * A MessageHandler adapter for invoking a Web Service. @@ -68,6 +69,13 @@ public class SimpleWebServiceHandler extends AbstractWebServiceHandler { new StringSource((String) requestPayload), requestCallback, result); return result.toString(); } + if(requestPayload instanceof Document){ + DOMResult result = new DOMResult(); + this.getWebServiceTemplate().sendSourceAndReceiveToResult( + new DOMSource((Document) requestPayload), requestCallback, result); + return (Document)result.getNode(); + + } throw new MessagingException("Unsupported payload type '" + requestPayload.getClass() + "'. " + this.getClass().getName() + " only supports 'java.lang.String' and '" + Source.class.getName() + "'. Consider using the '" + MarshallingWebServiceHandler.class.getName() + "' instead.");