Package org.opensaml.xml

Examples of org.opensaml.xml.XMLObject


     *          false means they should not be returned
     * @return the list of matching header blocks
     */
    public static List<XMLObject> getInboundHeaderBlock(MessageContext msgContext, QName headerName,
            Set<String> targetNodes, boolean isFinalDestination) {
        XMLObject inboundEnvelope = msgContext.getInboundMessage();
        if (inboundEnvelope == null) {
            throw new IllegalArgumentException("Message context does not contain an inbound SOAP envelope");
        }
       
        // SOAP 1.1 Envelope
View Full Code Here


     *          false specifies they should not be returned
     * @return the list of matching header blocks
     */
    public static List<XMLObject> getOutboundHeaderBlock(MessageContext msgContext, QName headerName,
            Set<String> targetNodes, boolean isFinalDestination) {
        XMLObject outboundEnvelope = msgContext.getOutboundMessage();
        if (outboundEnvelope == null) {
            throw new IllegalArgumentException("Message context does not contain an outbound SOAP envelope");
        }
       
        // SOAP 1.1 Envelope
View Full Code Here

     *
     * @param messageContext the current message context
     * @return true if the inbound message contains a SOAP Envelope, false otherwise
     */
    public static boolean isInboundSOAPMessage(MessageContext messageContext) {
        XMLObject inboundMessage = messageContext.getInboundMessage();
        if (inboundMessage == null) {
            return false;
        }
        // SOAP 1.1 Envelope
        if (inboundMessage instanceof Envelope) {
View Full Code Here

     * @throws MetadataProviderException thrown if there is a problem unmarshalling or filtering the new metadata
     */
    protected void processNewMetadata(String metadataIdentifier, DateTime refreshStart, byte[] metadataBytes)
            throws MetadataProviderException {
        log.debug("Unmarshalling metadata from '{}'", metadataIdentifier);
        XMLObject metadata = unmarshallMetadata(metadataBytes);

        if (!isValid(metadata)) {
            processPreExpiredMetadata(metadataIdentifier, refreshStart, metadataBytes, metadata);
        } else {
            processNonExpiredMetadata(metadataIdentifier, refreshStart, metadataBytes, metadata);
View Full Code Here

            throw new UnmarshallingException(
                    "Unable to unmarshall InputStream, no unmarshaller registered for element "
                            + XMLHelper.getNodeQName(messageElem));
        }

        XMLObject message = unmarshaller.unmarshall(messageElem);

        log.debug("InputStream succesfully unmarshalled");
        return message;
    }
View Full Code Here

            throw new UnmarshallingException(
                    "Unable to unmarshall Reader, no unmarshaller registered for element "
                            + XMLHelper.getNodeQName(messageElem));
        }

        XMLObject message = unmarshaller.unmarshall(messageElem);

        log.debug("Reader succesfully unmarshalled");
        return message;
    }
View Full Code Here

     * @param xmlObject the XMLObject from which to search
     * @param prefix the prefix to search
     * @return the namespace URI bound to the prefix, or none if not found
     */
    public static String lookupNamespaceURI(XMLObject xmlObject, String prefix) {
        XMLObject current = xmlObject;
       
        while (current != null) {
            for (Namespace ns : current.getNamespaces()) {
                if (DatatypeHelper.safeEquals(ns.getNamespacePrefix(), prefix)) {
                    return ns.getNamespaceURI();
                }
            }
            current = current.getParent();
        }
       
        return null;
    }
View Full Code Here

     * @param xmlObject the XMLObject from which to search
     * @param namespaceURI the namespace URI to search
     * @return the prefix bound to the namespace URI, or none if not found
     */
    public static String lookupNamespacePrefix(XMLObject xmlObject, String namespaceURI) {
        XMLObject current = xmlObject;
       
        while (current != null) {
            for (Namespace ns : current.getNamespaces()) {
                if (DatatypeHelper.safeEquals(ns.getNamespaceURI(), namespaceURI)) {
                    return ns.getNamespacePrefix();
                }
            }
            current = current.getParent();
        }
       
        return null;
    }
View Full Code Here

        String uri = rm.getURI();
        if (DatatypeHelper.isEmpty(uri) || !uri.startsWith("#")) {
            log.warn("EncryptedKey RetrievalMethod did not contain a same-document URI reference, can not process");
            return null;
        }
        XMLObject target = rm.resolveIDFromRoot(uri.substring(1));
        if (target == null) {
            log.warn("EncryptedKey RetrievalMethod URI could not be dereferenced");
            return null;
        }
        if (!(target instanceof EncryptedKey)) {
View Full Code Here

                    + ".  Unable to extract SAML message");
            throw new MessageDecodingException(
                    "Unexpected number of children in the SOAP body, unable to extract SAML message");
        }

        XMLObject incommingMessage = soapBodyChildren.get(0);
        if (!(incommingMessage instanceof SAMLObject)) {
            log.error("Unexpected SOAP body content.  Expected a SAML request but recieved {}", incommingMessage
                    .getElementQName());
            throw new MessageDecodingException("Unexpected SOAP body content.  Expected a SAML request but recieved "
                    + incommingMessage.getElementQName());
        }

        SAMLObject samlMessage = (SAMLObject) incommingMessage;
        log.debug("Decoded SOAP messaged which included SAML message of type {}", samlMessage.getElementQName());
        samlMsgCtx.setInboundSAMLMessage(samlMessage);
View Full Code Here

TOP

Related Classes of org.opensaml.xml.XMLObject

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.