Example usage for javax.xml.soap SOAPBody hasChildNodes

List of usage examples for javax.xml.soap SOAPBody hasChildNodes

Introduction

In this page you can find the example usage for javax.xml.soap SOAPBody hasChildNodes.

Prototype

public boolean hasChildNodes();

Source Link

Document

Returns whether this node has any children.

Usage

From source file:nl.nn.adapterframework.extensions.cxf.NamespaceUriProvider.java

public String findNamespaceUri() throws ListenerException {
    log.debug("trying to find serviceName from soapMessage[" + soapMessage + "]");

    try {//  w w w  .j a va 2 s .  com
        SOAPBody body = soapMessage.getSOAPBody();
        if (body.hasChildNodes()) {
            Iterator<?> it = body.getChildElements();
            while (it.hasNext()) {
                Node node = (Node) it.next();

                //Found first namespaceURI
                if (StringUtils.isNotEmpty(node.getNamespaceURI()))
                    return node.getNamespaceURI();
            }
        }
    } catch (SOAPException e) {
        throw new ListenerException(e);
    }

    throw new ListenerException("unable to determine serviceName from NamespaceURI");
}