String prefix = "myPrefix";
String uri = "myURI";
SOAPMessage msg = MessageFactory.newInstance().createMessage();
SOAPEnvelope envelope = msg.getSOAPPart().getEnvelope();
SOAPBody body = envelope.getBody();
body.addNamespaceDeclaration(prefix, uri);
boolean b = body.removeNamespaceDeclaration(prefix);
assertTrue("removeNamespaceDeclaration() did not return true", b);
b = body.removeNamespaceDeclaration(prefix);
assertFalse("removeNamespaceDeclaration() did not return false", b);
assertNull(body.getNamespaceURI(prefix));