This commit is contained in:
Arjen Poutsma
2007-07-31 13:11:13 +00:00
parent 7dbd98710e
commit 944dfe6c2a
2 changed files with 9 additions and 0 deletions

View File

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

View File

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