Example usage for javax.xml.soap SOAPElement createQName

List of usage examples for javax.xml.soap SOAPElement createQName

Introduction

In this page you can find the example usage for javax.xml.soap SOAPElement createQName.

Prototype

public QName createQName(String localName, String prefix) throws SOAPException;

Source Link

Document

Creates a QName whose namespace URI is the one associated with the parameter, prefix , in the context of this SOAPElement .

Usage

From source file:com.googlecode.ddom.frontend.saaj.SOAPElementTest.java

@Validated
@Test(expected = SOAPException.class)
public void testCreateQNameWithUnknownPrefix() throws Exception {
    SOAPElement element = saajUtil.createSOAPElement("urn:ns", "test", null);
    element.createQName("local", "nonexistingprefix");
}

From source file:com.googlecode.ddom.frontend.saaj.SOAPElementTest.java

@Validated
@Test/*from   w  ww  . ja  v a 2  s. c om*/
public void testCreateQNameWithAddNamespaceDeclaration() throws Exception {
    SOAPElement element = saajUtil.createSOAPElement("urn:ns", "test", null);
    element.addNamespaceDeclaration("p", "urn:test");
    QName qname = element.createQName("local", "p");
    assertEquals("p", qname.getPrefix());
    assertEquals("local", qname.getLocalPart());
    assertEquals("urn:test", qname.getNamespaceURI());
}