SWS-151
This commit is contained in:
@@ -270,6 +270,7 @@ public class Saaj11Implementation implements SaajImplementation {
|
||||
|
||||
public void removeContents(SOAPElement element) {
|
||||
for (Iterator iterator = element.getChildElements(); iterator.hasNext();) {
|
||||
iterator.next();
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -277,4 +277,12 @@ public abstract class AbstractSaajImplementationTestCase extends XMLTestCase {
|
||||
assertNotNull("No attachment part", attachmentPart);
|
||||
}
|
||||
|
||||
public void testRemoveContents() throws Exception {
|
||||
body.addBodyElement(new QName("foo", "bar"));
|
||||
|
||||
assertTrue("Body has child nodes", body.hasChildNodes());
|
||||
implementation.removeContents(message.getSOAPBody());
|
||||
assertFalse("Body has child nodes", body.hasChildNodes());
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user