Example usage for org.w3c.dom Node getLocalName

List of usage examples for org.w3c.dom Node getLocalName

Introduction

In this page you can find the example usage for org.w3c.dom Node getLocalName.

Prototype

public String getLocalName();

Source Link

Document

Returns the local part of the qualified name of this node.

Usage

From source file:org.apache.cxf.systest.provider.CXF4130Test.java

@Test
public void testCxf4130() throws Exception {
    InputStream body = getClass().getResourceAsStream("cxf4130data.txt");
    HttpClient client = new HttpClient();
    PostMethod post = new PostMethod(ADDRESS);
    post.setRequestEntity(new InputStreamRequestEntity(body, "text/xml"));
    client.executeMethod(post);/*  ww w. j a va 2 s  . com*/

    Document doc = StaxUtils.read(post.getResponseBodyAsStream());
    Element root = doc.getDocumentElement();
    Node child = root.getFirstChild();

    boolean foundBody = false;
    while (child != null) {
        if ("Body".equals(child.getLocalName())) {
            foundBody = true;
            assertEquals(1, child.getChildNodes().getLength());
            assertEquals("FooResponse", child.getFirstChild().getLocalName());
        }
        child = child.getNextSibling();
    }
    assertTrue("Did not find the soap:Body element", foundBody);
}

From source file:org.apache.cxf.systest.provider.CXF4818Test.java

@Test
public void testCXF4818() throws Exception {
    InputStream body = getClass().getResourceAsStream("cxf4818data.txt");
    HttpClient client = new HttpClient();
    PostMethod post = new PostMethod(ADDRESS);
    post.setRequestEntity(new InputStreamRequestEntity(body, "text/xml"));
    client.executeMethod(post);// w ww.jav  a  2s . com

    Document doc = StaxUtils.read(post.getResponseBodyAsStream());
    //System.out.println(StaxUtils.toString(doc));
    Element root = doc.getDocumentElement();
    Node child = root.getFirstChild();

    boolean foundBody = false;
    boolean foundHeader = false;
    while (child != null) {
        if ("Header".equals(child.getLocalName())) {
            foundHeader = true;
            assertFalse("Already found body", foundBody);
        } else if ("Body".equals(child.getLocalName())) {
            foundBody = true;
            assertTrue("Did not find header before the body", foundHeader);
        }
        child = child.getNextSibling();
    }
    assertTrue("Did not find the soap:Body element", foundBody);
    assertTrue("Did not find the soap:Header element", foundHeader);
}

From source file:org.apache.cxf.tools.wsdlto.frontend.jaxws.customization.JAXWSBindingParser.java

private boolean isJAXWSMethodElement(Node node) {
    return ToolConstants.NS_JAXWS_BINDINGS.equals(node.getNamespaceURI())
            && "method".equals(node.getLocalName());
}

From source file:org.apache.cxf.tools.wsdlto.frontend.jaxws.customization.JAXWSBindingParser.java

private boolean isPackageElement(Node node) {
    return ToolConstants.NS_JAXWS_BINDINGS.equals(node.getNamespaceURI())
            && "package".equals(node.getLocalName());
}

From source file:org.apache.cxf.tools.wsdlto.frontend.jaxws.customization.JAXWSBindingParser.java

private boolean isJAXWSParameterElement(Node node) {
    return (ToolConstants.NS_JAXWS_BINDINGS.equals(node.getNamespaceURI()))
            && "parameter".equals(node.getLocalName());

}

From source file:org.apache.cxf.tools.wsdlto.frontend.jaxws.customization.JAXWSBindingParser.java

private boolean isJAXWSClass(Node node) {
    return (ToolConstants.NS_JAXWS_BINDINGS.equals(node.getNamespaceURI()))
            && "class".equals(node.getLocalName());
}

From source file:org.apache.cxf.tools.wsdlto.frontend.jaxws.customization.JAXWSBindingParser.java

private boolean isJAXWSClassDoc(Node node) {
    return (ToolConstants.NS_JAXWS_BINDINGS.equals(node.getNamespaceURI()))
            && "javadoc".equals(node.getLocalName());
}

From source file:org.apache.cxf.tools.wsdlto.frontend.jaxws.customization.JAXWSBindingParser.java

private Boolean isAsyncElement(Node node) {
    return "enableAsyncMapping".equals(node.getLocalName())
            && ToolConstants.NS_JAXWS_BINDINGS.equals(node.getNamespaceURI());
}

From source file:org.apache.cxf.tools.wsdlto.frontend.jaxws.customization.JAXWSBindingParser.java

private Boolean isWrapperStyle(Node node) {
    return "enableWrapperStyle".equals(node.getLocalName())
            && ToolConstants.NS_JAXWS_BINDINGS.equals(node.getNamespaceURI());
}

From source file:org.apache.cxf.tools.wsdlto.frontend.jaxws.customization.JAXWSBindingParser.java

private Boolean isMIMEElement(Node node) {
    return "enableMIMEContent".equals(node.getLocalName())
            && ToolConstants.NS_JAXWS_BINDINGS.equals(node.getNamespaceURI());
}