Xerces 3 revisions.
[shibboleth/cpp-opensaml.git] / saml / saml2 / core / impl / Protocols20Impl.cpp
index 45b7915..a34993d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Copyright 2001-2006 Internet2
+ *  Copyright 2001-2007 Internet2
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 
 #include "internal.h"
 #include "exceptions.h"
-#include "saml/encryption/EncryptedKeyResolver.h"
 #include "saml2/core/Protocols.h"
 
 #include <xmltooling/AbstractComplexElement.h>
-#include <xmltooling/AbstractElementProxy.h>
 #include <xmltooling/AbstractSimpleElement.h>
-#include <xmltooling/encryption/Decrypter.h>
 #include <xmltooling/impl/AnyElement.h>
 #include <xmltooling/io/AbstractXMLObjectMarshaller.h>
 #include <xmltooling/io/AbstractXMLObjectUnmarshaller.h>
 
 using namespace opensaml::saml2p;
 using namespace opensaml::saml2;
-using namespace opensaml;
 using namespace xmlsignature;
 using namespace xmlencryption;
 using namespace xmltooling;
 using namespace std;
+using xmlconstants::XMLSIG_NS;
+using xmlconstants::XMLENC_NS;
+using xmlconstants::XML_BOOL_NULL;
+using samlconstants::SAML20_NS;
+using samlconstants::SAML20P_NS;
 
 #if defined (_MSC_VER)
     #pragma warning( push )
@@ -64,7 +65,7 @@ namespace opensaml {
 
         //TODO need unit test for this, using objects from another namespace
         class SAML_DLLLOCAL ExtensionsImpl : public virtual Extensions,
-             public AbstractElementProxy,
+             public AbstractComplexElement,
              public AbstractDOMCachingXMLObject,
              public AbstractXMLObjectMarshaller,
              public AbstractXMLObjectUnmarshaller
@@ -72,27 +73,26 @@ namespace opensaml {
         public:
             virtual ~ExtensionsImpl() {}
     
-            ExtensionsImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
+            ExtensionsImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
                 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
             }
                 
             ExtensionsImpl(const ExtensionsImpl& src)
-                    : AbstractXMLObject(src), AbstractElementProxy(src), AbstractDOMCachingXMLObject(src) {
-                for (list<XMLObject*>::const_iterator i=src.m_children.begin(); i!=src.m_children.end(); i++) {
-                    if (*i) {
-                        getXMLObjects().push_back((*i)->clone());
-                    }
-                }
+                    : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
+                VectorOf(XMLObject) v=getUnknownXMLObjects();
+                for (vector<XMLObject*>::const_iterator i=src.m_UnknownXMLObjects.begin(); i!=src.m_UnknownXMLObjects.end(); ++i)
+                    v.push_back((*i)->clone());
             }
             
             IMPL_XMLOBJECT_CLONE(Extensions);
+            IMPL_XMLOBJECT_CHILDREN(UnknownXMLObject,m_children.end());
     
         protected:
             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
                 // Unknown child.
                 const XMLCh* nsURI=root->getNamespaceURI();
-                if (!XMLString::equals(nsURI,SAMLConstants::SAML20P_NS) && nsURI && *nsURI) {
-                    getXMLObjects().push_back(childXMLObject);
+                if (!XMLString::equals(nsURI,SAML20P_NS) && nsURI && *nsURI) {
+                    getUnknownXMLObjects().push_back(childXMLObject);
                     return;
                 }
                 
@@ -115,7 +115,7 @@ namespace opensaml {
             public:
                 virtual ~StatusCodeImpl() {}
 
-                StatusCodeImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
+                StatusCodeImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
                     : AbstractXMLObject(nsURI, localName, prefix, schemaType)
                 {
                         init();
@@ -139,7 +139,7 @@ namespace opensaml {
                 }
 
                 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
-                    PROC_TYPED_CHILD(StatusCode,SAMLConstants::SAML20P_NS,false);
+                    PROC_TYPED_CHILD(StatusCode,SAML20P_NS,false);
                     AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
                 }
 
@@ -159,26 +159,22 @@ namespace opensaml {
             public:
                 virtual ~StatusDetailImpl() {}
 
-                StatusDetailImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
+                StatusDetailImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
                     : AbstractXMLObject(nsURI, localName, prefix, schemaType) { }
 
                 StatusDetailImpl(const StatusDetailImpl& src)
                         : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
-                    VectorOf(XMLObject) v=getDetails();
-                    for (vector<XMLObject*>::const_iterator i=src.m_Details.begin(); i!=src.m_Details.end(); i++) {
-                        if (*i) {
-                            v.push_back((*i)->clone());
-                        }
-                    }
+                    VectorOf(XMLObject) v=getUnknownXMLObjects();
+                    for (vector<XMLObject*>::const_iterator i=src.m_UnknownXMLObjects.begin(); i!=src.m_UnknownXMLObjects.end(); ++i)
+                        v.push_back((*i)->clone());
                 }
 
                 IMPL_XMLOBJECT_CLONE(StatusDetail);
-                IMPL_XMLOBJECT_CHILDREN(Detail,m_children.end());
+                IMPL_XMLOBJECT_CHILDREN(UnknownXMLObject,m_children.end());
 
             protected:
                 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
-                    getDetails().push_back(childXMLObject);
-                    AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
+                    getUnknownXMLObjects().push_back(childXMLObject);
                 }
         };
 
@@ -205,7 +201,7 @@ namespace opensaml {
         public:
             virtual ~StatusImpl() { }
     
-            StatusImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
+            StatusImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
                     : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
                 init();
             }
@@ -229,9 +225,9 @@ namespace opensaml {
         protected:
     
             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
-                PROC_TYPED_CHILD(StatusCode,SAMLConstants::SAML20P_NS,false);
-                PROC_TYPED_CHILD(StatusMessage,SAMLConstants::SAML20P_NS,false);
-                PROC_TYPED_CHILD(StatusDetail,SAMLConstants::SAML20P_NS,false);
+                PROC_TYPED_CHILD(StatusCode,SAML20P_NS,false);
+                PROC_TYPED_CHILD(StatusMessage,SAML20P_NS,false);
+                PROC_TYPED_CHILD(StatusDetail,SAML20P_NS,false);
                 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
             }
     
@@ -275,7 +271,7 @@ namespace opensaml {
                 delete m_IssueInstant;
             }
     
-            RequestAbstractTypeImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
+            RequestAbstractTypeImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
                 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
                 init();
             }
@@ -340,9 +336,9 @@ namespace opensaml {
             }
     
             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
-                PROC_TYPED_FOREIGN_CHILD(Issuer,saml2,SAMLConstants::SAML20_NS,false);
-                PROC_TYPED_FOREIGN_CHILD(Signature,xmlsignature,XMLConstants::XMLSIG_NS,false);
-                PROC_TYPED_CHILD(Extensions,SAMLConstants::SAML20P_NS,false);
+                PROC_TYPED_FOREIGN_CHILD(Issuer,saml2,SAML20_NS,false);
+                PROC_TYPED_FOREIGN_CHILD(Signature,xmlsignature,XMLSIG_NS,false);
+                PROC_TYPED_CHILD(Extensions,SAML20P_NS,false);
                 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
             }
     
@@ -362,7 +358,7 @@ namespace opensaml {
         public:
             virtual ~AssertionIDRequestImpl() { }
     
-            AssertionIDRequestImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
+            AssertionIDRequestImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
                 : AbstractXMLObject(nsURI, localName, prefix, schemaType) { }
                 
             AssertionIDRequestImpl(const AssertionIDRequestImpl& src) : AbstractXMLObject(src), RequestAbstractTypeImpl(src) {
@@ -384,7 +380,7 @@ namespace opensaml {
     
         protected:
             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
-                PROC_TYPED_FOREIGN_CHILDREN(AssertionIDRef,saml2,SAMLConstants::SAML20_NS,false);
+                PROC_TYPED_FOREIGN_CHILDREN(AssertionIDRef,saml2,SAML20_NS,false);
                 RequestAbstractTypeImpl::processChildElement(childXMLObject,root);
             }
         };
@@ -405,7 +401,7 @@ namespace opensaml {
         public:
             virtual ~SubjectQueryImpl() { }
     
-            SubjectQueryImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
+            SubjectQueryImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
                 : AbstractXMLObject(nsURI, localName, prefix, schemaType)
             { 
                 init();
@@ -421,7 +417,7 @@ namespace opensaml {
     
         protected:
             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
-                PROC_TYPED_FOREIGN_CHILD(Subject,saml2,SAMLConstants::SAML20_NS,false);
+                PROC_TYPED_FOREIGN_CHILD(Subject,saml2,SAML20_NS,false);
                 RequestAbstractTypeImpl::processChildElement(childXMLObject,root);
             }
         };
@@ -441,7 +437,7 @@ namespace opensaml {
                 XMLString::release(&m_Comparison);
             }
     
-            RequestedAuthnContextImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
+            RequestedAuthnContextImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
                     : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
                 init();
             }
@@ -478,8 +474,8 @@ namespace opensaml {
             }
     
             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
-                PROC_TYPED_FOREIGN_CHILDREN(AuthnContextClassRef,saml2,SAMLConstants::SAML20_NS,false);
-                PROC_TYPED_FOREIGN_CHILDREN(AuthnContextDeclRef,saml2,SAMLConstants::SAML20_NS,false);
+                PROC_TYPED_FOREIGN_CHILDREN(AuthnContextClassRef,saml2,SAML20_NS,false);
+                PROC_TYPED_FOREIGN_CHILDREN(AuthnContextDeclRef,saml2,SAML20_NS,false);
                 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
             }
     
@@ -505,7 +501,7 @@ namespace opensaml {
                 XMLString::release(&m_SessionIndex);
             }
     
-            AuthnQueryImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
+            AuthnQueryImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
                 : AbstractXMLObject(nsURI, localName, prefix, schemaType)
             {
                 init();
@@ -536,7 +532,7 @@ namespace opensaml {
             }
     
             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
-                PROC_TYPED_CHILD(RequestedAuthnContext,SAMLConstants::SAML20P_NS,false);
+                PROC_TYPED_CHILD(RequestedAuthnContext,SAML20P_NS,false);
                 SubjectQueryImpl::processChildElement(childXMLObject,root);
             }
             void processAttribute(const DOMAttr* attribute) {
@@ -550,7 +546,7 @@ namespace opensaml {
         public:
             virtual ~AttributeQueryImpl() { }
     
-            AttributeQueryImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
+            AttributeQueryImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
                 : AbstractXMLObject(nsURI, localName, prefix, schemaType) { }
                 
             AttributeQueryImpl(const AttributeQueryImpl& src) : AbstractXMLObject(src), SubjectQueryImpl(src) {
@@ -578,7 +574,7 @@ namespace opensaml {
     
         protected:
             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
-                PROC_TYPED_FOREIGN_CHILDREN(Attribute,saml2,SAMLConstants::SAML20_NS,false);
+                PROC_TYPED_FOREIGN_CHILDREN(Attribute,saml2,SAML20_NS,false);
                 SubjectQueryImpl::processChildElement(childXMLObject,root);
             }
         };
@@ -598,7 +594,7 @@ namespace opensaml {
                 XMLString::release(&m_Resource);
             }
     
-            AuthzDecisionQueryImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
+            AuthzDecisionQueryImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
                     : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
                 init();
             }
@@ -638,8 +634,8 @@ namespace opensaml {
             }
     
             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
-                PROC_TYPED_FOREIGN_CHILD(Evidence,saml2,SAMLConstants::SAML20_NS,false);
-                PROC_TYPED_FOREIGN_CHILDREN(Action,saml2,SAMLConstants::SAML20_NS,false);
+                PROC_TYPED_FOREIGN_CHILD(Evidence,saml2,SAML20_NS,false);
+                PROC_TYPED_FOREIGN_CHILDREN(Action,saml2,SAML20_NS,false);
                 SubjectQueryImpl::processChildElement(childXMLObject,root);
             }
             void processAttribute(const DOMAttr* attribute) {
@@ -657,7 +653,7 @@ namespace opensaml {
             void init() {
                 m_Format=NULL;
                 m_SPNameQualifier=NULL;
-                m_AllowCreate=XMLConstants::XML_BOOL_NULL;
+                m_AllowCreate=XML_BOOL_NULL;
             }
             public:
                 virtual ~NameIDPolicyImpl()
@@ -666,7 +662,7 @@ namespace opensaml {
                     XMLString::release(&m_SPNameQualifier);
                 }
 
-                NameIDPolicyImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
+                NameIDPolicyImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
                     : AbstractXMLObject(nsURI, localName, prefix, schemaType)
                 {
                         init();
@@ -719,7 +715,7 @@ namespace opensaml {
                     XMLString::release(&m_Loc);
                 }
 
-                IDPEntryImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
+                IDPEntryImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
                     : AbstractXMLObject(nsURI, localName, prefix, schemaType)
                 {
                         init();
@@ -768,7 +764,7 @@ namespace opensaml {
         public:
             virtual ~IDPListImpl() { }
     
-            IDPListImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
+            IDPListImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
                 : AbstractXMLObject(nsURI, localName, prefix, schemaType)
             {
                 init();
@@ -796,8 +792,8 @@ namespace opensaml {
     
         protected:
             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
-                PROC_TYPED_CHILDREN(IDPEntry,SAMLConstants::SAML20P_NS,false);
-                PROC_TYPED_CHILD(GetComplete,SAMLConstants::SAML20P_NS,false);
+                PROC_TYPED_CHILDREN(IDPEntry,SAML20P_NS,false);
+                PROC_TYPED_CHILD(GetComplete,SAML20P_NS,false);
                 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
             }
         };
@@ -821,7 +817,7 @@ namespace opensaml {
                 XMLString::release(&m_ProxyCount); 
             }
     
-            ScopingImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
+            ScopingImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
                 : AbstractXMLObject(nsURI, localName, prefix, schemaType)
             {
                 init();
@@ -855,8 +851,8 @@ namespace opensaml {
             }
     
             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
-                PROC_TYPED_CHILD(IDPList,SAMLConstants::SAML20P_NS,false);
-                PROC_TYPED_CHILDREN(RequesterID,SAMLConstants::SAML20P_NS,false);
+                PROC_TYPED_CHILD(IDPList,SAML20P_NS,false);
+                PROC_TYPED_CHILDREN(RequesterID,SAML20P_NS,false);
                 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
             }
 
@@ -869,8 +865,8 @@ namespace opensaml {
         class SAML_DLLLOCAL AuthnRequestImpl : public virtual AuthnRequest, public RequestAbstractTypeImpl
         {
             void init() {
-                m_ForceAuthn=XMLConstants::XML_BOOL_NULL;
-                m_IsPassive=XMLConstants::XML_BOOL_NULL;
+                m_ForceAuthn=XML_BOOL_NULL;
+                m_IsPassive=XML_BOOL_NULL;
                 m_ProtocolBinding=NULL;
                 m_AssertionConsumerServiceIndex=NULL;
                 m_AssertionConsumerServiceURL=NULL;
@@ -908,7 +904,7 @@ namespace opensaml {
                 XMLString::release(&m_AttributeConsumingServiceIndex);
             }
     
-            AuthnRequestImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
+            AuthnRequestImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
                 : AbstractXMLObject(nsURI, localName, prefix, schemaType)
             {
                 init();
@@ -969,11 +965,11 @@ namespace opensaml {
             }
     
             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
-                PROC_TYPED_FOREIGN_CHILD(Subject,saml2,SAMLConstants::SAML20_NS,false);
-                PROC_TYPED_CHILD(NameIDPolicy,SAMLConstants::SAML20P_NS,false);
-                PROC_TYPED_FOREIGN_CHILD(Conditions,saml2,SAMLConstants::SAML20_NS,false);
-                PROC_TYPED_CHILD(RequestedAuthnContext,SAMLConstants::SAML20P_NS,false);
-                PROC_TYPED_CHILD(Scoping,SAMLConstants::SAML20P_NS,false);
+                PROC_TYPED_FOREIGN_CHILD(Subject,saml2,SAML20_NS,false);
+                PROC_TYPED_CHILD(NameIDPolicy,SAML20P_NS,false);
+                PROC_TYPED_FOREIGN_CHILD(Conditions,saml2,SAML20_NS,false);
+                PROC_TYPED_CHILD(RequestedAuthnContext,SAML20P_NS,false);
+                PROC_TYPED_CHILD(Scoping,SAML20P_NS,false);
                 RequestAbstractTypeImpl::processChildElement(childXMLObject,root);
             }
             void processAttribute(const DOMAttr* attribute) {
@@ -1031,7 +1027,7 @@ namespace opensaml {
                 delete m_IssueInstant;
             }
     
-            StatusResponseTypeImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
+            StatusResponseTypeImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
                 : AbstractXMLObject(nsURI, localName, prefix, schemaType)
             {
                 init();
@@ -1103,10 +1099,10 @@ namespace opensaml {
             }
     
             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
-                PROC_TYPED_FOREIGN_CHILD(Issuer,saml2,SAMLConstants::SAML20_NS,false);
-                PROC_TYPED_FOREIGN_CHILD(Signature,xmlsignature,XMLConstants::XMLSIG_NS,false);
-                PROC_TYPED_CHILD(Extensions,SAMLConstants::SAML20P_NS,false);
-                PROC_TYPED_CHILD(Status,SAMLConstants::SAML20P_NS,false);
+                PROC_TYPED_FOREIGN_CHILD(Issuer,saml2,SAML20_NS,false);
+                PROC_TYPED_FOREIGN_CHILD(Signature,xmlsignature,XMLSIG_NS,false);
+                PROC_TYPED_CHILD(Extensions,SAML20P_NS,false);
+                PROC_TYPED_CHILD(Status,SAML20P_NS,false);
                 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
             }
     
@@ -1126,13 +1122,13 @@ namespace opensaml {
         public:
             virtual ~ResponseImpl() { }
     
-            ResponseImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
+            ResponseImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
                 : AbstractXMLObject(nsURI, localName, prefix, schemaType) { }
                 
             ResponseImpl(const ResponseImpl& src) : AbstractXMLObject(src), StatusResponseTypeImpl(src) {
                 for (list<XMLObject*>::const_iterator i=src.m_children.begin(); i!=src.m_children.end(); i++) {
                     if (*i) {
-                        Assertion* assertion=dynamic_cast<Assertion*>(*i);
+                        saml2::Assertion* assertion=dynamic_cast<saml2::Assertion*>(*i);
                         if (assertion) {
                             getAssertions().push_back(assertion->cloneAssertion());
                             continue;
@@ -1157,8 +1153,8 @@ namespace opensaml {
     
         protected:
             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
-                PROC_TYPED_FOREIGN_CHILDREN(Assertion,saml2,SAMLConstants::SAML20_NS,false);
-                PROC_TYPED_FOREIGN_CHILDREN(EncryptedAssertion,saml2,SAMLConstants::SAML20_NS,false);
+                PROC_TYPED_FOREIGN_CHILDREN(Assertion,saml2,SAML20_NS,false);
+                PROC_TYPED_FOREIGN_CHILDREN(EncryptedAssertion,saml2,SAML20_NS,false);
                 StatusResponseTypeImpl::processChildElement(childXMLObject,root);
             }
         };
@@ -1174,7 +1170,7 @@ namespace opensaml {
         public:
             virtual ~ArtifactResolveImpl() { }
     
-            ArtifactResolveImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
+            ArtifactResolveImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
                 : AbstractXMLObject(nsURI, localName, prefix, schemaType)
             { 
                 init();
@@ -1195,7 +1191,7 @@ namespace opensaml {
     
         protected:
             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
-                PROC_TYPED_CHILD(Artifact,SAMLConstants::SAML20P_NS,false);
+                PROC_TYPED_CHILD(Artifact,SAML20P_NS,false);
                 RequestAbstractTypeImpl::processChildElement(childXMLObject,root);
             }
         };
@@ -1211,7 +1207,7 @@ namespace opensaml {
         public:
             virtual ~ArtifactResponseImpl() { }
     
-            ArtifactResponseImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
+            ArtifactResponseImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
                 : AbstractXMLObject(nsURI, localName, prefix, schemaType)
             {
                 init();
@@ -1236,10 +1232,10 @@ namespace opensaml {
                 // These are valid elements for the parent StatusResponseType, so don't process these.
                 // If not one of these, then it must be the payload.
                 if (
-                    ! XMLHelper::isNodeNamed(root,SAMLConstants::SAML20_NS,saml2::Issuer::LOCAL_NAME) &&
-                    ! XMLHelper::isNodeNamed(root,XMLConstants::XMLSIG_NS,xmlsignature::Signature::LOCAL_NAME) &&
-                    ! XMLHelper::isNodeNamed(root,SAMLConstants::SAML20P_NS,saml2p::Extensions::LOCAL_NAME) &&
-                    ! XMLHelper::isNodeNamed(root,SAMLConstants::SAML20P_NS,saml2p::Status::LOCAL_NAME)
+                    ! XMLHelper::isNodeNamed(root,SAML20_NS,saml2::Issuer::LOCAL_NAME) &&
+                    ! XMLHelper::isNodeNamed(root,XMLSIG_NS,xmlsignature::Signature::LOCAL_NAME) &&
+                    ! XMLHelper::isNodeNamed(root,SAML20P_NS,saml2p::Extensions::LOCAL_NAME) &&
+                    ! XMLHelper::isNodeNamed(root,SAML20P_NS,saml2p::Status::LOCAL_NAME)
                    )
                 {
                     setPayload(childXMLObject);
@@ -1271,7 +1267,7 @@ namespace opensaml {
         public:
             virtual ~NewEncryptedIDImpl() {}
     
-            NewEncryptedIDImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
+            NewEncryptedIDImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
                     : AbstractXMLObject(nsURI, localName, prefix, schemaType)
             {
                 init();
@@ -1290,24 +1286,6 @@ namespace opensaml {
                 }
             }
     
-            XMLObject* decrypt(KeyResolver* KEKresolver, const XMLCh* recipient) const
-            {
-                if (!m_EncryptedData)
-                    throw DecryptionException("No encrypted data present.");
-                Decrypter decrypter(KEKresolver, new EncryptedKeyResolver(*this, recipient));
-                DOMDocumentFragment* frag = decrypter.decryptData(m_EncryptedData);
-                if (frag->hasChildNodes() && frag->getFirstChild()==frag->getLastChild()) {
-                    DOMNode* plaintext=frag->getFirstChild();
-                    if (plaintext->getNodeType()==DOMNode::ELEMENT_NODE) {
-                        auto_ptr<XMLObject> ret(XMLObjectBuilder::buildOneFromElement(static_cast<DOMElement*>(plaintext)));
-                        ret->releaseThisAndChildrenDOM();
-                        return ret.release();
-                    }
-                }
-                frag->release();
-                throw DecryptionException("Decryption did not result in a single element.");
-            }
-        
             IMPL_XMLOBJECT_CLONE(NewEncryptedID);
             EncryptedElementType* cloneEncryptedElementType() const {
                 return new NewEncryptedIDImpl(*this);
@@ -1318,8 +1296,8 @@ namespace opensaml {
     
         protected:
             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
-                PROC_TYPED_FOREIGN_CHILD(EncryptedData,xmlencryption,XMLConstants::XMLENC_NS,false);
-                PROC_TYPED_FOREIGN_CHILDREN(EncryptedKey,xmlencryption,XMLConstants::XMLENC_NS,false);
+                PROC_TYPED_FOREIGN_CHILD(EncryptedData,xmlencryption,XMLENC_NS,false);
+                PROC_TYPED_FOREIGN_CHILDREN(EncryptedKey,xmlencryption,XMLENC_NS,false);
                 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
             }
         };
@@ -1333,7 +1311,7 @@ namespace opensaml {
             public:
                 virtual ~TerminateImpl() { }
 
-                TerminateImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
+                TerminateImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
                     : AbstractXMLObject(nsURI, localName, prefix, schemaType) { }
 
                 TerminateImpl(const TerminateImpl& src)
@@ -1374,7 +1352,7 @@ namespace opensaml {
         public:
             virtual ~ManageNameIDRequestImpl() { }
     
-            ManageNameIDRequestImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
+            ManageNameIDRequestImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
                 : AbstractXMLObject(nsURI, localName, prefix, schemaType)
             {
                 init();
@@ -1409,11 +1387,11 @@ namespace opensaml {
     
         protected:
             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
-                PROC_TYPED_FOREIGN_CHILD(NameID,saml2,SAMLConstants::SAML20_NS,false);
-                PROC_TYPED_FOREIGN_CHILD(EncryptedID,saml2,SAMLConstants::SAML20_NS,false);
-                PROC_TYPED_CHILD(NewID,SAMLConstants::SAML20P_NS,false);
-                PROC_TYPED_CHILD(NewEncryptedID,SAMLConstants::SAML20P_NS,false);
-                PROC_TYPED_CHILD(Terminate,SAMLConstants::SAML20P_NS,false);
+                PROC_TYPED_FOREIGN_CHILD(NameID,saml2,SAML20_NS,false);
+                PROC_TYPED_FOREIGN_CHILD(EncryptedID,saml2,SAML20_NS,false);
+                PROC_TYPED_CHILD(NewID,SAML20P_NS,false);
+                PROC_TYPED_CHILD(NewEncryptedID,SAML20P_NS,false);
+                PROC_TYPED_CHILD(Terminate,SAML20P_NS,false);
                 RequestAbstractTypeImpl::processChildElement(childXMLObject,root);
             }
         };
@@ -1423,7 +1401,7 @@ namespace opensaml {
         public:
             virtual ~ManageNameIDResponseImpl() { }
 
-            ManageNameIDResponseImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
+            ManageNameIDResponseImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
                 : AbstractXMLObject(nsURI, localName, prefix, schemaType) { }
             
             ManageNameIDResponseImpl(const ManageNameIDResponseImpl& src) : AbstractXMLObject(src), StatusResponseTypeImpl(src) {
@@ -1461,7 +1439,7 @@ namespace opensaml {
                 delete m_NotOnOrAfter;
             }
     
-            LogoutRequestImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
+            LogoutRequestImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
                 : AbstractXMLObject(nsURI, localName, prefix, schemaType)
             {
                 init();
@@ -1511,10 +1489,10 @@ namespace opensaml {
             }
     
             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
-                PROC_TYPED_FOREIGN_CHILD(BaseID,saml2,SAMLConstants::SAML20_NS,false);
-                PROC_TYPED_FOREIGN_CHILD(NameID,saml2,SAMLConstants::SAML20_NS,false);
-                PROC_TYPED_FOREIGN_CHILD(EncryptedID,saml2,SAMLConstants::SAML20_NS,false);
-                PROC_TYPED_CHILDREN(SessionIndex,SAMLConstants::SAML20P_NS,false);
+                PROC_TYPED_FOREIGN_CHILD(BaseID,saml2,SAML20_NS,false);
+                PROC_TYPED_FOREIGN_CHILD(NameID,saml2,SAML20_NS,false);
+                PROC_TYPED_FOREIGN_CHILD(EncryptedID,saml2,SAML20_NS,false);
+                PROC_TYPED_CHILDREN(SessionIndex,SAML20P_NS,false);
                 RequestAbstractTypeImpl::processChildElement(childXMLObject,root);
             }
             void processAttribute(const DOMAttr* attribute) {
@@ -1529,7 +1507,7 @@ namespace opensaml {
         public:
             virtual ~LogoutResponseImpl() { }
 
-            LogoutResponseImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
+            LogoutResponseImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
                 : AbstractXMLObject(nsURI, localName, prefix, schemaType) { }
             
             LogoutResponseImpl(const LogoutResponseImpl& src) : AbstractXMLObject(src), StatusResponseTypeImpl(src) {
@@ -1566,7 +1544,7 @@ namespace opensaml {
         public:
             virtual ~NameIDMappingRequestImpl() { }
     
-            NameIDMappingRequestImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
+            NameIDMappingRequestImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
                 : AbstractXMLObject(nsURI, localName, prefix, schemaType)
             {
                 init();
@@ -1598,10 +1576,10 @@ namespace opensaml {
     
         protected:
             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
-                PROC_TYPED_FOREIGN_CHILD(BaseID,saml2,SAMLConstants::SAML20_NS,false);
-                PROC_TYPED_FOREIGN_CHILD(NameID,saml2,SAMLConstants::SAML20_NS,false);
-                PROC_TYPED_FOREIGN_CHILD(EncryptedID,saml2,SAMLConstants::SAML20_NS,false);
-                PROC_TYPED_CHILD(NameIDPolicy,SAMLConstants::SAML20P_NS,false);
+                PROC_TYPED_FOREIGN_CHILD(BaseID,saml2,SAML20_NS,false);
+                PROC_TYPED_FOREIGN_CHILD(NameID,saml2,SAML20_NS,false);
+                PROC_TYPED_FOREIGN_CHILD(EncryptedID,saml2,SAML20_NS,false);
+                PROC_TYPED_CHILD(NameIDPolicy,SAML20P_NS,false);
                 RequestAbstractTypeImpl::processChildElement(childXMLObject,root);
             }
         };
@@ -1621,7 +1599,7 @@ namespace opensaml {
         public:
             virtual ~NameIDMappingResponseImpl() { }
     
-            NameIDMappingResponseImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
+            NameIDMappingResponseImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
                 : AbstractXMLObject(nsURI, localName, prefix, schemaType)
             {
                 init();
@@ -1647,8 +1625,8 @@ namespace opensaml {
     
         protected:
             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
-                PROC_TYPED_FOREIGN_CHILD(NameID,saml2,SAMLConstants::SAML20_NS,false);
-                PROC_TYPED_FOREIGN_CHILD(EncryptedID,saml2,SAMLConstants::SAML20_NS,false);
+                PROC_TYPED_FOREIGN_CHILD(NameID,saml2,SAML20_NS,false);
+                PROC_TYPED_FOREIGN_CHILD(EncryptedID,saml2,SAML20_NS,false);
                 StatusResponseTypeImpl::processChildElement(childXMLObject,root);
             }
         };