Minor axiom changes
This commit is contained in:
13
core/pom.xml
13
core/pom.xml
@@ -50,7 +50,18 @@
|
||||
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
|
||||
</archive>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<version>2.3</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>test-jar</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
<dependencies>
|
||||
|
||||
@@ -65,7 +65,7 @@ abstract class AxiomSoapBody extends AxiomSoapElement implements SoapBody {
|
||||
return (SOAPBody) getAxiomElement();
|
||||
}
|
||||
|
||||
public void setPayloadSource(StreamingPayload payload) {
|
||||
public void setStreamingPayload(StreamingPayload payload) {
|
||||
Assert.notNull(payload, "'payload' must not be null");
|
||||
OMDataSource dataSource = new StreamingOMDataSource(payload);
|
||||
OMElement payloadElement = getAxiomFactory().createOMElement(dataSource, payload.getName());
|
||||
|
||||
@@ -170,7 +170,7 @@ public class AxiomSoapMessage extends AbstractSoapMessage implements StreamingWe
|
||||
|
||||
public void setStreamingPayload(StreamingPayload payload) {
|
||||
AxiomSoapBody soapBody = (AxiomSoapBody) getSoapBody();
|
||||
soapBody.setPayloadSource(payload);
|
||||
soapBody.setStreamingPayload(payload);
|
||||
}
|
||||
|
||||
public SoapEnvelope getEnvelope() {
|
||||
|
||||
@@ -32,7 +32,6 @@ import org.springframework.ws.stream.StreamingPayload;
|
||||
import org.springframework.ws.stream.StreamingWebServiceMessage;
|
||||
import org.springframework.ws.transport.MockTransportOutputStream;
|
||||
import org.springframework.ws.transport.TransportConstants;
|
||||
import org.springframework.xml.namespace.SimpleNamespaceContext;
|
||||
import org.springframework.xml.transform.StringResult;
|
||||
import org.springframework.xml.validation.XmlValidator;
|
||||
import org.springframework.xml.validation.XmlValidatorFactory;
|
||||
@@ -95,18 +94,15 @@ public abstract class AbstractSoapMessageTestCase extends AbstractMimeMessageTes
|
||||
}
|
||||
StreamingWebServiceMessage streamingMessage = (StreamingWebServiceMessage) soapMessage;
|
||||
|
||||
final QName name = new QName("http://springframework.org", "root");
|
||||
final QName name = new QName("http://springframework.org", "root", "prefix");
|
||||
streamingMessage.setStreamingPayload(new StreamingPayload() {
|
||||
public QName getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void writeTo(XMLStreamWriter streamWriter) throws XMLStreamException {
|
||||
SimpleNamespaceContext namespaceContext = new SimpleNamespaceContext();
|
||||
namespaceContext.bindDefaultNamespaceUri(name.getNamespaceURI());
|
||||
streamWriter.setNamespaceContext(namespaceContext);
|
||||
streamWriter.writeStartElement(name.getNamespaceURI(), name.getLocalPart());
|
||||
streamWriter.writeDefaultNamespace(name.getNamespaceURI());
|
||||
streamWriter.writeStartElement(name.getPrefix(), name.getLocalPart(), name.getNamespaceURI());
|
||||
streamWriter.writeNamespace("prefix", name.getNamespaceURI());
|
||||
streamWriter.writeStartElement(name.getNamespaceURI(), "child");
|
||||
streamWriter.writeCharacters("Foo");
|
||||
streamWriter.writeEndElement();
|
||||
@@ -119,6 +115,8 @@ public abstract class AbstractSoapMessageTestCase extends AbstractMimeMessageTes
|
||||
|
||||
String expected = "<root xmlns='http://springframework.org'><child>Foo</child></root>";
|
||||
assertXMLEqual(expected, result.toString());
|
||||
|
||||
soapMessage.writeTo(new ByteArrayOutputStream());
|
||||
}
|
||||
|
||||
protected abstract Resource[] getSoapSchemas();
|
||||
|
||||
Reference in New Issue
Block a user