Package org.opensaml.xml.io

Examples of org.opensaml.xml.io.Unmarshaller.unmarshall()


     */
    public static XMLObject unmarshall(Element element) throws UnmarshallingException {
        synchronized (lock) {
            UnmarshallerFactory unmarshallerFactory = Configuration.getUnmarshallerFactory();
            Unmarshaller unmarshaller = unmarshallerFactory.getUnmarshaller(element);
            XMLObject xmlObject = unmarshaller.unmarshall(element);
            return xmlObject;
        }
    }

    /**
 
View Full Code Here


            Unmarshaller unmarshaller = Configuration.getUnmarshallerFactory().getUnmarshaller(samlElement);
            if (unmarshaller == null) {
                fail("Unable to retrieve unmarshaller by DOM Element");
            }

            return unmarshaller.unmarshall(samlElement);
        } catch (XMLParserException e) {
            fail("Unable to parse element file " + elementFile);
        } catch (UnmarshallingException e) {
            fail("Unmarshalling failed when parsing element file " + elementFile + ": " + e);
        }
View Full Code Here

            Element element = document.getDocumentElement();
            UnmarshallerFactory unmarshallerFactory = Configuration
                    .getUnmarshallerFactory();
            Unmarshaller unmarshaller = unmarshallerFactory
                    .getUnmarshaller(element);
            assertion = (org.opensaml.saml1.core.Assertion) unmarshaller
                    .unmarshall(element);
        } catch (Exception e){
            e.printStackTrace();
        }
        return  assertion;
View Full Code Here

        ByteArrayInputStream is = new ByteArrayInputStream(Base64.decode(kiBase64));
        KeyInfo keyInfo = null;
        try {
            Document doc = parser.parse(is);
            keyInfo = (KeyInfo) unmarshaller.unmarshall(doc.getDocumentElement());
        } catch (XMLParserException e) {
            log.error("Error parsing KeyInfo data", e);
            throw new SecurityPolicyException("Error parsing KeyInfo data", e);
        } catch (UnmarshallingException e) {
            log.error("Error unmarshalling KeyInfo data", e);
View Full Code Here

        /** {@inheritDoc} */
        public SAMLObject getSamlMessage() {
            try {
                Element messageElem = parserPool.parse(new StringReader(serializedMessage)).getDocumentElement();
                Unmarshaller unmarshaller = Configuration.getUnmarshallerFactory().getUnmarshaller(messageElem);
                return (SAMLObject) unmarshaller.unmarshall(messageElem);
            } catch (Exception e) {
                log.error("Unable to deserialize and unmarshall SAML message associated with artifact " + artifact, e);
                return null;
            }
        }
View Full Code Here

     *             metadata
     */
    private synchronized void refreshMetadata() throws MetadataProviderException {
        try {
            Unmarshaller unmarshaller = unmarshallerFactory.getUnmarshaller(metadataElement);
            metadata = unmarshaller.unmarshall(metadataElement);
            metadata.releaseDOM();
            metadata.releaseChildrenDOM(true);
            filterMetadata(metadata);
            emitChangeEvent();
        } catch (UnmarshallingException e) {
View Full Code Here

            log.trace("Parsing retrieved metadata into a DOM object");
            Document mdDocument = parser.parse(metadataInput);

            log.trace("Unmarshalling and caching metdata DOM");
            Unmarshaller unmarshaller = unmarshallerFactory.getUnmarshaller(mdDocument.getDocumentElement());
            XMLObject metadata = unmarshaller.unmarshall(mdDocument.getDocumentElement());
            return metadata;
        } catch (Exception e) {
            throw new UnmarshallingException(e);
        } finally {
            try {
View Full Code Here

            // log.info("Metadata document passed validation");
            // }

            Element metadataRoot = metadatDocument.getDocumentElement();
            Unmarshaller unmarshaller = Configuration.getUnmarshallerFactory().getUnmarshaller(metadataRoot);
            return unmarshaller.unmarshall(metadataRoot);
        } catch (MalformedURLException e) {
            errorAndExit("Input file/url was not properly formed", e);
        } catch (XMLParserException e) {
            errorAndExit("Unable to parse and validate metadata document", e);
        } catch (IOException e) {
View Full Code Here

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

            T message = (T) unmarshaller.unmarshall(messageElem);

            log.debug("Message successfully unmarshalled");
            return message;
        } catch (XMLParserException e) {
            log.error("Encountered error parsing message into its DOM representation", e);
View Full Code Here

            final Document responseDocument = this.basicParserPool.parse(new ByteArrayInputStream(getBytes(response)));
            final Element responseRoot = responseDocument.getDocumentElement();
            final UnmarshallerFactory unmarshallerFactory = Configuration.getUnmarshallerFactory();
            final Unmarshaller unmarshaller = unmarshallerFactory.getUnmarshaller(responseRoot);
            final Envelope envelope = (Envelope) unmarshaller.unmarshall(responseRoot);
            final Response samlResponse = (Response) envelope.getBody().getOrderedChildren().get(0);

            final List<org.opensaml.saml1.core.Assertion> assertions = samlResponse.getAssertions();
            if (assertions.isEmpty()) {
                throw new TicketValidationException("No assertions found.");
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.