Java 类javax.xml.soap.SOAPFaultElement 实例源码

项目:wso2-axis2    文件:SOAPFaultImpl.java   
private Iterator getChildren(Iterator childIter) {
    Collection childElements = new ArrayList();
    while (childIter.hasNext()) {
        org.w3c.dom.Node domNode = (org.w3c.dom.Node)childIter.next();
        Node saajNode = toSAAJNode(domNode);
        if (!(saajNode instanceof SOAPFaultElement)) {
            // silently replace node, as per saaj 1.2 spec
            SOAPFaultElement bodyEle = new SOAPFaultElementImpl((ElementImpl)domNode);
            ((NodeImpl)domNode).setUserData(SAAJ_NODE, bodyEle, null);
            childElements.add(bodyEle);
        } else {
            childElements.add(saajNode);
        }
    }
    return childElements.iterator();
}
项目:wso2-axis2    文件:SOAPElementImpl.java   
/**
 * Sets the encoding style for this SOAPElement object to one specified.
 *
 * @param encodingStyle - a String giving the encoding style
 * @throws IllegalArgumentException
 *          - if there was a problem in the encoding style being set. SOAPException - if setting
 *          the encodingStyle is invalid for this SOAPElement.
 */
public void setEncodingStyle(String encodingStyle) throws SOAPException {
    if (this.element.getOMFactory() instanceof SOAP11Factory) {
        try {
            URI uri = new URI(encodingStyle);
            if (!(this instanceof SOAPEnvelope)) {
                if (!encodingStyle.equals(SOAPConstants.URI_NS_SOAP_ENCODING)) {
                    throw new IllegalArgumentException(
                            "Invalid Encoding style : " + encodingStyle);
                }
            }
            this.encodingStyle = encodingStyle;
        } catch (URISyntaxException e) {
            throw new IllegalArgumentException("Invalid Encoding style : "
                    + encodingStyle + ":" + e);
        }
    } else if (this.element.getOMFactory() instanceof SOAP12Factory) {
        if (this instanceof SOAPHeader || this instanceof SOAPBody ||
                this instanceof SOAPFault ||
                this instanceof SOAPFaultElement || this instanceof SOAPEnvelope ||
                this instanceof Detail) {
            throw new SOAPException("EncodingStyle attribute cannot appear in : " + this);
        }
    }
}