Package org.opensaml.xml.io

Examples of org.opensaml.xml.io.Unmarshaller


     * @throws MetadataProviderException thrown if the metadata element provided can not be read or is not valid
     *             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


        try {
            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

            // parser.validate(metadatDocument);
            // 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

            if (log.isTraceEnabled()) {
                log.trace("Unmarshalled message into DOM:\n{}", XMLHelper.nodeToString(messageElem));
            }

            log.debug("Unmarshalling message DOM");
            Unmarshaller unmarshaller = Configuration.getUnmarshallerFactory().getUnmarshaller(messageElem);
            if (unmarshaller == null) {
                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

        try {

            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

Related Classes of org.opensaml.xml.io.Unmarshaller

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.