Minor axiom changes

This commit is contained in:
Arjen Poutsma
2010-09-09 11:54:42 +00:00
parent 9d57c86742
commit c736a52d53
4 changed files with 19 additions and 10 deletions

View File

@@ -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>

View File

@@ -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());

View File

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

View File

@@ -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();