Java Code Examples for javax.xml.soap.SOAPElement#detachNode()

The following examples show how to use javax.xml.soap.SOAPElement#detachNode() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Fault1_2Impl.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
@Override
public void setFaultNode(String uri) throws SOAPException {
    SOAPElement faultNode = findAndConvertChildElement(getFaultNodeName());
    if (faultNode != null) {
        faultNode.detachNode();
    }
    faultNode = createSOAPFaultElement(getFaultNodeName());
    faultNode = faultNode.addTextNode(uri);
    if (getFaultRole() != null) {
        insertBefore(faultNode, this.faultActorElement);
        return;
    }
    if (hasDetail()) {
        insertBefore(faultNode, this.detail);
        return;
    }
    addNode(faultNode);
}
 
Example 2
Source File: Fault1_2Impl.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
private void removeDefaultFaultString() throws SOAPException {
    SOAPElement reasonText = getFaultReasonTextElement(Locale.getDefault());
    if (reasonText != null) {
        String defaultFaultString =
            "Fault string, and possibly fault code, not set";
        if (defaultFaultString.equals(reasonText.getValue())) {
            reasonText.detachNode();
        }
    }
}
 
Example 3
Source File: Fault1_2Impl.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void removeAllFaultSubcodes() {
    if (this.faultCodeElement == null)
        findFaultCodeElement();
    Iterator subcodeElements =
        this.faultCodeElement.getChildElements(subcodeName);
    if (subcodeElements.hasNext()) {
        SOAPElement subcode = (SOAPElement) subcodeElements.next();
        subcode.detachNode();
    }
}