Package org.opensaml.xml.io

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


      Document document = docBuilder.parse(new ByteArrayInputStream(authReqStr.trim()
          .getBytes()));
      Element element = document.getDocumentElement();
      UnmarshallerFactory unmarshallerFactory = Configuration.getUnmarshallerFactory();
      Unmarshaller unmarshaller = unmarshallerFactory.getUnmarshaller(element);
      response = unmarshaller.unmarshall(element);
      // Check for duplicate samlp:Response
      NodeList list = response.getDOM().getElementsByTagNameNS( SAMLConstants.SAML20P_NS,"Response");
      if (list.getLength() > 0) {
        log.error("Invalid schema for the SAML2 reponse");
        throw new SAML2SSOAuthenticatorException("Error occured while processing saml2 response");
View Full Code Here


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

            XMLObject message = unmarshaller.unmarshall(messageElem);

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

                String msg ="No unmarshaller registered for document element " + XMLHelper
                        .getNodeQName(mdDocument.getDocumentElement());
                log.error(msg);
                throw new UnmarshallingException(msg);
            }
            XMLObject metadata = unmarshaller.unmarshall(mdDocument.getDocumentElement());
            return metadata;
        } catch (Exception e) {
            throw new UnmarshallingException(e);
        } finally {
            try {
View Full Code Here

            Element responseElem = parserPool.parse(responseStream).getDocumentElement();
            if (log.isDebugEnabled()) {
                log.debug("Inbound SOAP message was:\n" + XMLHelper.prettyPrintXML(responseElem));
            }
            Unmarshaller unmarshaller = Configuration.getUnmarshallerFactory().getUnmarshaller(responseElem);
            return (Envelope) unmarshaller.unmarshall(responseElem);
        } catch (XMLParserException e) {
            throw new SOAPClientException("Unable to parse the XML within the response", e);
        } catch (UnmarshallingException e) {
            throw new SOAPClientException("unable to unmarshall the response DOM", e);
        }
View Full Code Here

        } else {
            clonedElement = (Element) origElement.cloneNode(true);
        }
       
        Unmarshaller unmarshaller = Configuration.getUnmarshallerFactory().getUnmarshaller(clonedElement);
        T clonedXMLObject = (T) unmarshaller.unmarshall(clonedElement);
       
        return clonedXMLObject;
    }
   
    /**
 
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

   
    /** {@inheritDoc} */
    protected void doInitialization() throws MetadataProviderException {
        try {
            Unmarshaller unmarshaller = unmarshallerFactory.getUnmarshaller(metadataElement);
            XMLObject metadataTemp = unmarshaller.unmarshall(metadataElement);
            filterMetadata(metadataTemp);
            releaseMetadataDOM(metadataTemp);
            metadata = metadataTemp;
            emitChangeEvent();
        } catch (UnmarshallingException e) {
View Full Code Here

            org.apache.xml.security.keys.KeyInfo xmlSecKeyInfo = xmlSignature.getKeyInfo();
            if (xmlSecKeyInfo != null) {
                log.debug("Adding KeyInfo to Signature");
                Unmarshaller unmarshaller = Configuration.getUnmarshallerFactory().getUnmarshaller(
                        xmlSecKeyInfo.getElement());
                KeyInfo keyInfo = (KeyInfo) unmarshaller.unmarshall(xmlSecKeyInfo.getElement());
                signature.setKeyInfo(keyInfo);
            }
            signature.setXMLSignature(xmlSignature);
            signature.setDOM(signatureElement);
            return signature;
View Full Code Here

                        String errorMsg = "Unable to locate unmarshaller for " + XMLHelper.getNodeQName(element);
                        log.error(errorMsg);
                        throw new DecryptionException(errorMsg);
                    }
                }
                xmlObject = unmarshaller.unmarshall(element);
            } catch (UnmarshallingException e) {
                log.error("There was an error during unmarshalling of the decrypted element", e);
                throw new DecryptionException("Unmarshalling error during decryption", e);
            }
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.