Java Code Examples for com.sun.xml.internal.ws.util.DOMUtil#getChildElements()

The following examples show how to use com.sun.xml.internal.ws.util.DOMUtil#getChildElements() . 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: SOAP11Fault.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * This constructor takes soap fault detail among other things. The detail could represent {@link javax.xml.soap.Detail}
 * or a java object that can be marshalled/unmarshalled by JAXB.
 *
 * @param code
 * @param reason
 * @param actor
 * @param detailObject
 */
SOAP11Fault(QName code, String reason, String actor, Element detailObject) {
    this.faultcode = code;
    this.faultstring = reason;
    this.faultactor = actor;
    if (detailObject != null) {
        if ((detailObject.getNamespaceURI() == null ||
             "".equals(detailObject.getNamespaceURI())) && "detail".equals(detailObject.getLocalName())) {
            detail = new DetailType();
            for(Element detailEntry : DOMUtil.getChildElements(detailObject)) {
                detail.getDetails().add(detailEntry);
            }
        } else {
            detail = new DetailType(detailObject);
        }
    }
}
 
Example 2
Source File: SOAP11Fault.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 * This constructor takes soap fault detail among other things. The detail could represent {@link javax.xml.soap.Detail}
 * or a java object that can be marshalled/unmarshalled by JAXB.
 *
 * @param code
 * @param reason
 * @param actor
 * @param detailObject
 */
SOAP11Fault(QName code, String reason, String actor, Element detailObject) {
    this.faultcode = code;
    this.faultstring = reason;
    this.faultactor = actor;
    if (detailObject != null) {
        if ((detailObject.getNamespaceURI() == null ||
             "".equals(detailObject.getNamespaceURI())) && "detail".equals(detailObject.getLocalName())) {
            detail = new DetailType();
            for(Element detailEntry : DOMUtil.getChildElements(detailObject)) {
                detail.getDetails().add(detailEntry);
            }
        } else {
            detail = new DetailType(detailObject);
        }
    }
}
 
Example 3
Source File: SAAJMessage.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
protected void access() {
    if (!accessedMessage) {
        try {
            envelopeAttrs = sm.getSOAPPart().getEnvelope().getAttributes();
            Node body = sm.getSOAPBody();
            bodyAttrs = body.getAttributes();
            soapVersion = SOAPVersion.fromNsUri(body.getNamespaceURI());
            //cature all the body elements
            bodyParts = DOMUtil.getChildElements(body);
            //we treat payload as the first body part
            payload = bodyParts.size() > 0 ? bodyParts.get(0) : null;
            // hope this is correct. Caching the localname and namespace of the payload should be fine
            // but what about if a Handler replaces the payload with something else? Weel, may be it
            // will be error condition anyway
            if (payload != null) {
                payloadLocalName = payload.getLocalName();
                payloadNamespace = payload.getNamespaceURI();
            }
            accessedMessage = true;
        } catch (SOAPException e) {
            throw new WebServiceException(e);
        }
    }
}
 
Example 4
Source File: SOAP12Fault.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
SOAP12Fault(CodeType code, ReasonType reason, String node, String role, Element detailObject) {
    this.code = code;
    this.reason = reason;
    this.node = node;
    this.role = role;
    if (detailObject != null) {
        if(detailObject.getNamespaceURI().equals(ns) && detailObject.getLocalName().equals("Detail")){
            detail = new DetailType();
            for(Element detailEntry : DOMUtil.getChildElements(detailObject)){
                detail.getDetails().add(detailEntry);
            }
        }else{
            detail = new DetailType(detailObject);
        }
    }
}
 
Example 5
Source File: SOAP11Fault.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * This constructor takes soap fault detail among other things. The detail could represent {@link javax.xml.soap.Detail}
 * or a java object that can be marshalled/unmarshalled by JAXB.
 *
 * @param code
 * @param reason
 * @param actor
 * @param detailObject
 */
SOAP11Fault(QName code, String reason, String actor, Element detailObject) {
    this.faultcode = code;
    this.faultstring = reason;
    this.faultactor = actor;
    if (detailObject != null) {
        if ((detailObject.getNamespaceURI() == null ||
             "".equals(detailObject.getNamespaceURI())) && "detail".equals(detailObject.getLocalName())) {
            detail = new DetailType();
            for(Element detailEntry : DOMUtil.getChildElements(detailObject)) {
                detail.getDetails().add(detailEntry);
            }
        } else {
            detail = new DetailType(detailObject);
        }
    }
}
 
Example 6
Source File: SOAP11Fault.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * This constructor takes soap fault detail among other things. The detail could represent {@link javax.xml.soap.Detail}
 * or a java object that can be marshalled/unmarshalled by JAXB.
 *
 * @param code
 * @param reason
 * @param actor
 * @param detailObject
 */
SOAP11Fault(QName code, String reason, String actor, Element detailObject) {
    this.faultcode = code;
    this.faultstring = reason;
    this.faultactor = actor;
    if (detailObject != null) {
        if ((detailObject.getNamespaceURI() == null ||
             "".equals(detailObject.getNamespaceURI())) && "detail".equals(detailObject.getLocalName())) {
            detail = new DetailType();
            for(Element detailEntry : DOMUtil.getChildElements(detailObject)) {
                detail.getDetails().add(detailEntry);
            }
        } else {
            detail = new DetailType(detailObject);
        }
    }
}
 
Example 7
Source File: SOAP12Fault.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
SOAP12Fault(CodeType code, ReasonType reason, String node, String role, Element detailObject) {
    this.code = code;
    this.reason = reason;
    this.node = node;
    this.role = role;
    if (detailObject != null) {
        if(detailObject.getNamespaceURI().equals(ns) && detailObject.getLocalName().equals("Detail")){
            detail = new DetailType();
            for(Element detailEntry : DOMUtil.getChildElements(detailObject)){
                detail.getDetails().add(detailEntry);
            }
        }else{
            detail = new DetailType(detailObject);
        }
    }
}
 
Example 8
Source File: SOAP11Fault.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * This constructor takes soap fault detail among other things. The detail could represent {@link javax.xml.soap.Detail}
 * or a java object that can be marshalled/unmarshalled by JAXB.
 *
 * @param code
 * @param reason
 * @param actor
 * @param detailObject
 */
SOAP11Fault(QName code, String reason, String actor, Element detailObject) {
    this.faultcode = code;
    this.faultstring = reason;
    this.faultactor = actor;
    if (detailObject != null) {
        if ((detailObject.getNamespaceURI() == null ||
             "".equals(detailObject.getNamespaceURI())) && "detail".equals(detailObject.getLocalName())) {
            detail = new DetailType();
            for(Element detailEntry : DOMUtil.getChildElements(detailObject)) {
                detail.getDetails().add(detailEntry);
            }
        } else {
            detail = new DetailType(detailObject);
        }
    }
}
 
Example 9
Source File: SAAJMessage.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
protected void access() {
    if (!accessedMessage) {
        try {
            envelopeAttrs = sm.getSOAPPart().getEnvelope().getAttributes();
            Node body = sm.getSOAPBody();
            bodyAttrs = body.getAttributes();
            soapVersion = SOAPVersion.fromNsUri(body.getNamespaceURI());
            //cature all the body elements
            bodyParts = DOMUtil.getChildElements(body);
            //we treat payload as the first body part
            payload = bodyParts.size() > 0 ? bodyParts.get(0) : null;
            // hope this is correct. Caching the localname and namespace of the payload should be fine
            // but what about if a Handler replaces the payload with something else? Weel, may be it
            // will be error condition anyway
            if (payload != null) {
                payloadLocalName = payload.getLocalName();
                payloadNamespace = payload.getNamespaceURI();
            }
            accessedMessage = true;
        } catch (SOAPException e) {
            throw new WebServiceException(e);
        }
    }
}
 
Example 10
Source File: SOAP12Fault.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
SOAP12Fault(CodeType code, ReasonType reason, String node, String role, Element detailObject) {
    this.code = code;
    this.reason = reason;
    this.node = node;
    this.role = role;
    if (detailObject != null) {
        if(detailObject.getNamespaceURI().equals(ns) && detailObject.getLocalName().equals("Detail")){
            detail = new DetailType();
            for(Element detailEntry : DOMUtil.getChildElements(detailObject)){
                detail.getDetails().add(detailEntry);
            }
        }else{
            detail = new DetailType(detailObject);
        }
    }
}
 
Example 11
Source File: SAAJMessage.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
protected void access() {
    if (!accessedMessage) {
        try {
            envelopeAttrs = sm.getSOAPPart().getEnvelope().getAttributes();
            Node body = sm.getSOAPBody();
            bodyAttrs = body.getAttributes();
            soapVersion = SOAPVersion.fromNsUri(body.getNamespaceURI());
            //cature all the body elements
            bodyParts = DOMUtil.getChildElements(body);
            //we treat payload as the first body part
            payload = bodyParts.size() > 0 ? bodyParts.get(0) : null;
            // hope this is correct. Caching the localname and namespace of the payload should be fine
            // but what about if a Handler replaces the payload with something else? Weel, may be it
            // will be error condition anyway
            if (payload != null) {
                payloadLocalName = payload.getLocalName();
                payloadNamespace = payload.getNamespaceURI();
            }
            accessedMessage = true;
        } catch (SOAPException e) {
            throw new WebServiceException(e);
        }
    }
}
 
Example 12
Source File: SAAJMessage.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
protected void access() {
    if (!accessedMessage) {
        try {
            envelopeAttrs = sm.getSOAPPart().getEnvelope().getAttributes();
            Node body = sm.getSOAPBody();
            bodyAttrs = body.getAttributes();
            soapVersion = SOAPVersion.fromNsUri(body.getNamespaceURI());
            //cature all the body elements
            bodyParts = DOMUtil.getChildElements(body);
            //we treat payload as the first body part
            payload = bodyParts.size() > 0 ? bodyParts.get(0) : null;
            // hope this is correct. Caching the localname and namespace of the payload should be fine
            // but what about if a Handler replaces the payload with something else? Weel, may be it
            // will be error condition anyway
            if (payload != null) {
                payloadLocalName = payload.getLocalName();
                payloadNamespace = payload.getNamespaceURI();
            }
            accessedMessage = true;
        } catch (SOAPException e) {
            throw new WebServiceException(e);
        }
    }
}
 
Example 13
Source File: SOAP12Fault.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
SOAP12Fault(CodeType code, ReasonType reason, String node, String role, Element detailObject) {
    this.code = code;
    this.reason = reason;
    this.node = node;
    this.role = role;
    if (detailObject != null) {
        if(detailObject.getNamespaceURI().equals(ns) && detailObject.getLocalName().equals("Detail")){
            detail = new DetailType();
            for(Element detailEntry : DOMUtil.getChildElements(detailObject)){
                detail.getDetails().add(detailEntry);
            }
        }else{
            detail = new DetailType(detailObject);
        }
    }
}
 
Example 14
Source File: SOAP11Fault.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * This constructor takes soap fault detail among other things. The detail could represent {@link javax.xml.soap.Detail}
 * or a java object that can be marshalled/unmarshalled by JAXB.
 *
 * @param code
 * @param reason
 * @param actor
 * @param detailObject
 */
SOAP11Fault(QName code, String reason, String actor, Element detailObject) {
    this.faultcode = code;
    this.faultstring = reason;
    this.faultactor = actor;
    if (detailObject != null) {
        if ((detailObject.getNamespaceURI() == null ||
             "".equals(detailObject.getNamespaceURI())) && "detail".equals(detailObject.getLocalName())) {
            detail = new DetailType();
            for(Element detailEntry : DOMUtil.getChildElements(detailObject)) {
                detail.getDetails().add(detailEntry);
            }
        } else {
            detail = new DetailType(detailObject);
        }
    }
}
 
Example 15
Source File: SAAJMessage.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
protected void access() {
    if (!accessedMessage) {
        try {
            envelopeAttrs = sm.getSOAPPart().getEnvelope().getAttributes();
            Node body = sm.getSOAPBody();
            bodyAttrs = body.getAttributes();
            soapVersion = SOAPVersion.fromNsUri(body.getNamespaceURI());
            //cature all the body elements
            bodyParts = DOMUtil.getChildElements(body);
            //we treat payload as the first body part
            payload = bodyParts.size() > 0 ? bodyParts.get(0) : null;
            // hope this is correct. Caching the localname and namespace of the payload should be fine
            // but what about if a Handler replaces the payload with something else? Weel, may be it
            // will be error condition anyway
            if (payload != null) {
                payloadLocalName = payload.getLocalName();
                payloadNamespace = payload.getNamespaceURI();
            }
            accessedMessage = true;
        } catch (SOAPException e) {
            throw new WebServiceException(e);
        }
    }
}
 
Example 16
Source File: SOAP12Fault.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
SOAP12Fault(CodeType code, ReasonType reason, String node, String role, Element detailObject) {
    this.code = code;
    this.reason = reason;
    this.node = node;
    this.role = role;
    if (detailObject != null) {
        if(detailObject.getNamespaceURI().equals(ns) && detailObject.getLocalName().equals("Detail")){
            detail = new DetailType();
            for(Element detailEntry : DOMUtil.getChildElements(detailObject)){
                detail.getDetails().add(detailEntry);
            }
        }else{
            detail = new DetailType(detailObject);
        }
    }
}
 
Example 17
Source File: SAAJMessage.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
protected void access() {
    if (!accessedMessage) {
        try {
            envelopeAttrs = sm.getSOAPPart().getEnvelope().getAttributes();
            Node body = sm.getSOAPBody();
            bodyAttrs = body.getAttributes();
            soapVersion = SOAPVersion.fromNsUri(body.getNamespaceURI());
            //cature all the body elements
            bodyParts = DOMUtil.getChildElements(body);
            //we treat payload as the first body part
            payload = bodyParts.size() > 0 ? bodyParts.get(0) : null;
            // hope this is correct. Caching the localname and namespace of the payload should be fine
            // but what about if a Handler replaces the payload with something else? Weel, may be it
            // will be error condition anyway
            if (payload != null) {
                payloadLocalName = payload.getLocalName();
                payloadNamespace = payload.getNamespaceURI();
            }
            accessedMessage = true;
        } catch (SOAPException e) {
            throw new WebServiceException(e);
        }
    }
}
 
Example 18
Source File: SAAJMessage.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
protected void access() {
    if (!accessedMessage) {
        try {
            envelopeAttrs = sm.getSOAPPart().getEnvelope().getAttributes();
            Node body = sm.getSOAPBody();
            bodyAttrs = body.getAttributes();
            soapVersion = SOAPVersion.fromNsUri(body.getNamespaceURI());
            //cature all the body elements
            bodyParts = DOMUtil.getChildElements(body);
            //we treat payload as the first body part
            payload = bodyParts.size() > 0 ? bodyParts.get(0) : null;
            // hope this is correct. Caching the localname and namespace of the payload should be fine
            // but what about if a Handler replaces the payload with something else? Weel, may be it
            // will be error condition anyway
            if (payload != null) {
                payloadLocalName = payload.getLocalName();
                payloadNamespace = payload.getNamespaceURI();
            }
            accessedMessage = true;
        } catch (SOAPException e) {
            throw new WebServiceException(e);
        }
    }
}
 
Example 19
Source File: SOAP12Fault.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
SOAP12Fault(CodeType code, ReasonType reason, String node, String role, Element detailObject) {
    this.code = code;
    this.reason = reason;
    this.node = node;
    this.role = role;
    if (detailObject != null) {
        if(detailObject.getNamespaceURI().equals(ns) && detailObject.getLocalName().equals("Detail")){
            detail = new DetailType();
            for(Element detailEntry : DOMUtil.getChildElements(detailObject)){
                detail.getDetails().add(detailEntry);
            }
        }else{
            detail = new DetailType(detailObject);
        }
    }
}
 
Example 20
Source File: SOAP12Fault.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
SOAP12Fault(CodeType code, ReasonType reason, String node, String role, Element detailObject) {
    this.code = code;
    this.reason = reason;
    this.node = node;
    this.role = role;
    if (detailObject != null) {
        if(detailObject.getNamespaceURI().equals(ns) && detailObject.getLocalName().equals("Detail")){
            detail = new DetailType();
            for(Element detailEntry : DOMUtil.getChildElements(detailObject)){
                detail.getDetails().add(detailEntry);
            }
        }else{
            detail = new DetailType(detailObject);
        }
    }
}