Package org.opensaml.xml.io

Examples of org.opensaml.xml.io.UnmarshallingException


            int minor;
            try {
                minor = Integer.parseInt(attribute.getValue());
            } catch (NumberFormatException n) {
                log.error("Unable to parse minor version string", n);
                throw new UnmarshallingException(n);
            }
            if (minor == 0) {
                request.setVersion(SAMLVersion.VERSION_10);
            } else if (minor == 1) {
                request.setVersion(SAMLVersion.VERSION_11);
View Full Code Here


        log.debug("Unmarshalling DOM parsed from InputStream");
        Unmarshaller unmarshaller = Configuration.getUnmarshallerFactory().getUnmarshaller(messageElem);
        if (unmarshaller == null) {
            log.error("Unable to unmarshall InputStream, no unmarshaller registered for element "
                    + XMLHelper.getNodeQName(messageElem));
            throw new UnmarshallingException(
                    "Unable to unmarshall InputStream, no unmarshaller registered for element "
                            + XMLHelper.getNodeQName(messageElem));
        }

        XMLObject message = unmarshaller.unmarshall(messageElem);
View Full Code Here

        log.debug("Unmarshalling DOM parsed from Reader");
        Unmarshaller unmarshaller = Configuration.getUnmarshallerFactory().getUnmarshaller(messageElem);
        if (unmarshaller == null) {
            log.error("Unable to unmarshall Reader, no unmarshaller registered for element "
                    + XMLHelper.getNodeQName(messageElem));
            throw new UnmarshallingException(
                    "Unable to unmarshall Reader, no unmarshaller registered for element "
                            + XMLHelper.getNodeQName(messageElem));
        }

        XMLObject message = unmarshaller.unmarshall(messageElem);
View Full Code Here

            } else if ("maximum".equals(attribute.getValue())) {
                rac.setComparison(AuthnContextComparisonTypeEnumeration.MAXIMUM);
            } else if ("better".equals(attribute.getValue())) {
                rac.setComparison(AuthnContextComparisonTypeEnumeration.BETTER);
            } else {
                throw new UnmarshallingException("Saw an invalid value for Comparison attribute: "
                        + attribute.getValue());
            }
        } else {
            super.processAttribute(samlObject, attribute);
        }
View Full Code Here

            signature.setXMLSignature(xmlSignature);
            signature.setDOM(signatureElement);
            return signature;
        } catch (XMLSecurityException e) {
            log.error("Error constructing Apache XMLSignature instance from Signature element: {}", e.getMessage());
            throw new UnmarshallingException("Unable to unmarshall Signature with Apache XMLSignature", e);
        }
    }
View Full Code Here

        if (attribute.getName().equals(KeyDescriptor.USE_ATTRIB_NAME)) {
            try {
                UsageType usageType = UsageType.valueOf(UsageType.class, attribute.getValue().toUpperCase());
                // Only allow the enum values specified in the schema.
                if (usageType != UsageType.SIGNING && usageType != UsageType.ENCRYPTION) {
                    throw new UnmarshallingException("Invalid key usage type: " + attribute.getValue());
                }
                keyDescriptor.setUse(usageType);
            } catch (IllegalArgumentException e) {
                throw new UnmarshallingException("Invalid key usage type: " + attribute.getValue());
            }
        }

        super.processAttribute(samlObject, attribute);
    }
View Full Code Here

        Unmarshaller mock = createMock(Unmarshaller.class);
        Unmarshaller old = Configuration.getUnmarshallerFactory().getUnmarshaller(assertion.getElementQName());
        Configuration.getUnmarshallerFactory().registerUnmarshaller(assertion.getElementQName(), mock);

        expect(mock.unmarshall((Element) notNull())).andThrow(new UnmarshallingException(""));

        try {
            replay(mock);
            SAMLBase o = (SAMLBase) input.readObject();
            o.getObject();
View Full Code Here

        if (attribute.getName().equals(KeyDescriptor.USE_ATTRIB_NAME)) {
            try {
                UsageType usageType =  UsageType.valueOf(UsageType.class, attribute.getValue().toUpperCase());
                // Only allow the enum values specified in the schema.
                if (usageType != UsageType.SIGNING && usageType != UsageType.ENCRYPTION) {
                    throw new UnmarshallingException("Invalid key usage type: " + attribute.getValue());
                }
                keyDescriptor.setUse(usageType);
            } catch (IllegalArgumentException e) {
                throw new UnmarshallingException("Invalid key usage type: " + attribute.getValue());
            }
        }

        super.processAttribute(samlObject, attribute);
    }
View Full Code Here

            } else if (value.equals(DecisionTypeEnumeration.DENY.toString())) {
                authzDS.setDecision(DecisionTypeEnumeration.DENY);
            } else if (value.equals(DecisionTypeEnumeration.INDETERMINATE.toString())) {
                authzDS.setDecision(DecisionTypeEnumeration.INDETERMINATE);
            } else {
                throw new UnmarshallingException("Unknown value for DecisionType '" + value + "'");
            }
        } else {
            super.processAttribute(samlObject, attribute);
        }
    }
View Full Code Here

            int minor;
            try {
                minor = Integer.parseInt(attribute.getValue());
            } catch (NumberFormatException n) {
                log.error("Parsing minor version ", n);
                throw new UnmarshallingException(n);
            }
            if (minor == 0) {
                response.setVersion(SAMLVersion.VERSION_10);
            } else if (minor == 1) {
                response.setVersion(SAMLVersion.VERSION_11);
View Full Code Here

TOP

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

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.