List of usage examples for javax.xml.soap SOAPElement lookupPrefix
public String lookupPrefix(String namespaceURI);
From source file:com.googlecode.ddom.frontend.saaj.SOAPElementTest.java
/** * Test that a call do {@link SOAPElement#addNamespaceDeclaration(String, String)} for a prefix * that is already declared on the same element will replace the existing namespace declaration. * /*w w w . j av a 2 s .c o m*/ * @throws SOAPException */ @Validated @Test public void testAddNamespaceDeclarationForExistingPrefix() throws SOAPException { SOAPElement element = saajUtil.createSOAPElement(null, "test", null); element.addNamespaceDeclaration("p", "urn:ns1"); element.addNamespaceDeclaration("p", "urn:ns2"); assertEquals("urn:ns2", element.lookupNamespaceURI("p")); assertNull(element.lookupPrefix("urn:ns1")); assertEquals("p", element.lookupPrefix("urn:ns2")); }