Fixed #SWS-87: AbstractSoapMessage.getPayloadSource returns null with Axis SAAJ

This commit is contained in:
Arjen Poutsma
2007-02-14 15:46:26 +00:00
parent 1edf7347fe
commit 1705bb2b00
6 changed files with 24 additions and 19 deletions

View File

@@ -32,7 +32,6 @@ import javax.xml.soap.MimeHeader;
import javax.xml.soap.MimeHeaders;
import javax.xml.soap.Name;
import javax.xml.soap.SOAPBody;
import javax.xml.soap.SOAPBodyElement;
import javax.xml.soap.SOAPElement;
import javax.xml.soap.SOAPEnvelope;
import javax.xml.soap.SOAPException;
@@ -264,11 +263,11 @@ public class Saaj11Implementation implements SaajImplementation {
return detail.getDetailEntries();
}
public SOAPBodyElement getFirstBodyElement(SOAPBody body) {
public SOAPElement getFirstBodyElement(SOAPBody body) {
for (Iterator iterator = body.getChildElements(); iterator.hasNext();) {
Object child = iterator.next();
if (child instanceof SOAPBodyElement) {
return (SOAPBodyElement) child;
if (child instanceof SOAPElement) {
return (SOAPElement) child;
}
}
return null;

View File

@@ -30,7 +30,6 @@ import javax.xml.soap.MimeHeader;
import javax.xml.soap.MimeHeaders;
import javax.xml.soap.Name;
import javax.xml.soap.SOAPBody;
import javax.xml.soap.SOAPBodyElement;
import javax.xml.soap.SOAPElement;
import javax.xml.soap.SOAPEnvelope;
import javax.xml.soap.SOAPException;
@@ -180,11 +179,11 @@ public class Saaj12Implementation implements SaajImplementation {
return detail.getDetailEntries();
}
public SOAPBodyElement getFirstBodyElement(SOAPBody body) {
public SOAPElement getFirstBodyElement(SOAPBody body) {
for (Iterator iterator = body.getChildElements(); iterator.hasNext();) {
Object child = iterator.next();
if (child instanceof SOAPBodyElement) {
return (SOAPBodyElement) child;
if (child instanceof SOAPElement) {
return (SOAPElement) child;
}
}
return null;

View File

@@ -29,7 +29,6 @@ import javax.xml.soap.DetailEntry;
import javax.xml.soap.MimeHeader;
import javax.xml.soap.MimeHeaders;
import javax.xml.soap.SOAPBody;
import javax.xml.soap.SOAPBodyElement;
import javax.xml.soap.SOAPConstants;
import javax.xml.soap.SOAPElement;
import javax.xml.soap.SOAPEnvelope;
@@ -217,11 +216,11 @@ public class Saaj13Implementation implements SaajImplementation {
return detail.getDetailEntries();
}
public SOAPBodyElement getFirstBodyElement(SOAPBody body) {
public SOAPElement getFirstBodyElement(SOAPBody body) {
for (Iterator iterator = body.getChildElements(); iterator.hasNext();) {
Object child = iterator.next();
if (child instanceof SOAPBodyElement) {
return (SOAPBodyElement) child;
if (child instanceof SOAPElement) {
return (SOAPElement) child;
}
}
return null;

View File

@@ -27,7 +27,6 @@ import javax.xml.soap.Detail;
import javax.xml.soap.DetailEntry;
import javax.xml.soap.MimeHeaders;
import javax.xml.soap.SOAPBody;
import javax.xml.soap.SOAPBodyElement;
import javax.xml.soap.SOAPElement;
import javax.xml.soap.SOAPEnvelope;
import javax.xml.soap.SOAPException;
@@ -175,7 +174,7 @@ public interface SaajImplementation {
/**
* Returns the first child element of the given body.
*/
SOAPBodyElement getFirstBodyElement(SOAPBody body);
SOAPElement getFirstBodyElement(SOAPBody body);
/**
* Removes the contents (i.e. children) of the element.

View File

@@ -105,6 +105,7 @@ public class SaajSoapMessage extends AbstractSoapMessage {
public void writeTo(OutputStream outputStream) throws IOException {
try {
getImplementation().writeTo(getSaajMessage(), outputStream);
outputStream.flush();
}
catch (SOAPException ex) {
throw new SaajSoapMessageException("Could not write message to OutputStream: " + ex.getMessage(), ex);

View File

@@ -37,7 +37,7 @@ import org.springframework.ws.transport.TransportInputStream;
/**
* SAAJ-specific implementation of the {@link org.springframework.ws.WebServiceMessageFactory WebServiceMessageFactory}.
* This factory will use SAAJ 1.3 when found, or fall back to SAAJ 1.2.
* This factory will use SAAJ 1.3 when found, or fall back to SAAJ 1.2 or 1.1.
*
* @author Arjen Poutsma
* @see org.springframework.ws.soap.saaj.SaajSoapMessage
@@ -50,21 +50,29 @@ public class SaajSoapMessageFactory implements WebServiceMessageFactory, Initial
private String messageFactoryProtocol;
/** Default, empty constructor. */
/**
* Default, empty constructor.
*/
public SaajSoapMessageFactory() {
}
/** Constructor that takes a message factory as an argument. */
/**
* Constructor that takes a message factory as an argument.
*/
public SaajSoapMessageFactory(MessageFactory messageFactory) {
this.messageFactory = messageFactory;
}
/** Sets the SAAJ <code>MessageFactory</code>. */
/**
* Sets the SAAJ <code>MessageFactory</code>.
*/
public void setMessageFactory(MessageFactory messageFactory) {
this.messageFactory = messageFactory;
}
/** Returns the SAAJ <code>MessageFactory</code> used. */
/**
* Returns the SAAJ <code>MessageFactory</code> used.
*/
public MessageFactory getSaajMessageFactory() {
return messageFactory;
}