diff --git a/core/src/main/java/org/springframework/ws/WebServiceMessageFactory.java b/core/src/main/java/org/springframework/ws/WebServiceMessageFactory.java index 23b4af4e..bcec06e1 100644 --- a/core/src/main/java/org/springframework/ws/WebServiceMessageFactory.java +++ b/core/src/main/java/org/springframework/ws/WebServiceMessageFactory.java @@ -29,14 +29,14 @@ import java.io.InputStream; * @see org.springframework.ws.WebServiceMessage * @since 1.0.0 */ -public interface WebServiceMessageFactory { +public interface WebServiceMessageFactory { /** * Creates a new, empty WebServiceMessage. * * @return the empty message */ - T createWebServiceMessage(); + WebServiceMessage createWebServiceMessage(); /** * Reads a {@link WebServiceMessage} from the given input stream. @@ -48,6 +48,6 @@ public interface WebServiceMessageFactory { * @return the created message * @throws java.io.IOException if an I/O exception occurs */ - T createWebServiceMessage(InputStream inputStream) throws IOException; + WebServiceMessage createWebServiceMessage(InputStream inputStream) throws IOException; } diff --git a/core/src/main/java/org/springframework/ws/pox/dom/DomPoxMessageFactory.java b/core/src/main/java/org/springframework/ws/pox/dom/DomPoxMessageFactory.java index c96c7676..9425f5b7 100644 --- a/core/src/main/java/org/springframework/ws/pox/dom/DomPoxMessageFactory.java +++ b/core/src/main/java/org/springframework/ws/pox/dom/DomPoxMessageFactory.java @@ -37,7 +37,7 @@ import org.xml.sax.SAXException; * @see org.springframework.ws.pox.dom.DomPoxMessage * @since 1.0.0 */ -public class DomPoxMessageFactory extends TransformerObjectSupport implements WebServiceMessageFactory { +public class DomPoxMessageFactory extends TransformerObjectSupport implements WebServiceMessageFactory { /** The default content type for the POX messages. */ public static final String DEFAULT_CONTENT_TYPE = "application/xml"; diff --git a/core/src/main/java/org/springframework/ws/soap/SoapMessageFactory.java b/core/src/main/java/org/springframework/ws/soap/SoapMessageFactory.java index e3717159..c01c91f7 100644 --- a/core/src/main/java/org/springframework/ws/soap/SoapMessageFactory.java +++ b/core/src/main/java/org/springframework/ws/soap/SoapMessageFactory.java @@ -16,6 +16,9 @@ package org.springframework.ws.soap; +import java.io.IOException; +import java.io.InputStream; + import org.springframework.ws.WebServiceMessageFactory; /** @@ -27,7 +30,7 @@ import org.springframework.ws.WebServiceMessageFactory; * @author Arjen Poutsma * @since 1.0.0 */ -public interface SoapMessageFactory extends WebServiceMessageFactory { +public interface SoapMessageFactory extends WebServiceMessageFactory { /** * Sets the SOAP Version used by this factory. @@ -38,4 +41,23 @@ public interface SoapMessageFactory extends WebServiceMes */ void setSoapVersion(SoapVersion version); + /** + * Creates a new, empty SoapMessage. + * + * @return the empty message + */ + SoapMessage createWebServiceMessage(); + + /** + * Reads a {@link SoapMessage} from the given input stream. + *

+ * If the given stream is an instance of {@link org.springframework.ws.transport.TransportInputStream + * TransportInputStream}, the headers will be read from the request. + * + * @param inputStream the input stream to read the message from + * @return the created message + * @throws java.io.IOException if an I/O exception occurs + */ + SoapMessage createWebServiceMessage(InputStream inputStream) throws IOException; + } diff --git a/core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoapMessageFactory.java b/core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoapMessageFactory.java index f0937da3..a8c5ac0d 100644 --- a/core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoapMessageFactory.java +++ b/core/src/main/java/org/springframework/ws/soap/axiom/AxiomSoapMessageFactory.java @@ -78,7 +78,7 @@ import org.apache.commons.logging.LogFactory; * @see #setPayloadCaching(boolean) * @since 1.0.0 */ -public class AxiomSoapMessageFactory implements SoapMessageFactory, InitializingBean { +public class AxiomSoapMessageFactory implements SoapMessageFactory, InitializingBean { private static final String CHARSET_PARAMETER = "charset"; diff --git a/core/src/main/java/org/springframework/ws/soap/saaj/SaajSoapMessageFactory.java b/core/src/main/java/org/springframework/ws/soap/saaj/SaajSoapMessageFactory.java index 675638d0..a3e7c699 100644 --- a/core/src/main/java/org/springframework/ws/soap/saaj/SaajSoapMessageFactory.java +++ b/core/src/main/java/org/springframework/ws/soap/saaj/SaajSoapMessageFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2005-2010 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -55,7 +55,7 @@ import org.apache.commons.logging.LogFactory; * @see org.springframework.ws.soap.saaj.SaajSoapMessage * @since 1.0.0 */ -public class SaajSoapMessageFactory implements SoapMessageFactory, InitializingBean { +public class SaajSoapMessageFactory implements SoapMessageFactory, InitializingBean { private static final Log logger = LogFactory.getLog(SaajSoapMessageFactory.class); diff --git a/core/src/test/java/org/springframework/ws/MockWebServiceMessageFactory.java b/core/src/test/java/org/springframework/ws/MockWebServiceMessageFactory.java index 021a8a76..41a4bba7 100644 --- a/core/src/test/java/org/springframework/ws/MockWebServiceMessageFactory.java +++ b/core/src/test/java/org/springframework/ws/MockWebServiceMessageFactory.java @@ -21,7 +21,7 @@ import java.io.InputStream; import javax.xml.transform.TransformerException; import javax.xml.transform.stream.StreamSource; -public class MockWebServiceMessageFactory implements WebServiceMessageFactory { +public class MockWebServiceMessageFactory implements WebServiceMessageFactory { public MockWebServiceMessage createWebServiceMessage() { return new MockWebServiceMessage(); diff --git a/sandbox/src/main/java/org/springframework/ws/soap/stroap/StroapMessageFactory.java b/sandbox/src/main/java/org/springframework/ws/soap/stroap/StroapMessageFactory.java index e01874f9..e942d154 100644 --- a/sandbox/src/main/java/org/springframework/ws/soap/stroap/StroapMessageFactory.java +++ b/sandbox/src/main/java/org/springframework/ws/soap/stroap/StroapMessageFactory.java @@ -30,7 +30,7 @@ import org.springframework.ws.soap.SoapVersion; /** * @author Arjen Poutsma */ -public class StroapMessageFactory implements SoapMessageFactory { +public class StroapMessageFactory implements SoapMessageFactory { private final XMLInputFactory inputFactory = createXmlInputFactory();