Refined ElementProxy/ElementExtensible interfaces to match Java.
authorScott Cantor <cantor.2@osu.edu>
Mon, 27 Nov 2006 21:26:49 +0000 (21:26 +0000)
committerScott Cantor <cantor.2@osu.edu>
Mon, 27 Nov 2006 21:26:49 +0000 (21:26 +0000)
23 files changed:
saml/saml1/binding/impl/SAML1SOAPClient.cpp
saml/saml1/binding/impl/SAML1SOAPDecoder.cpp
saml/saml1/binding/impl/SAML1SOAPEncoder.cpp
saml/saml1/core/Assertions.h
saml/saml1/core/Protocols.h
saml/saml1/core/impl/AssertionsImpl.cpp
saml/saml1/core/impl/AssertionsSchemaValidators.cpp
saml/saml1/core/impl/ProtocolsImpl.cpp
saml/saml2/binding/impl/SAML2SOAPClient.cpp
saml/saml2/binding/impl/SAML2SOAPDecoder.cpp
saml/saml2/binding/impl/SAML2SOAPEncoder.cpp
saml/saml2/core/Assertions.h
saml/saml2/core/Protocols.h
saml/saml2/core/impl/Assertions20Impl.cpp
saml/saml2/core/impl/Assertions20SchemaValidators.cpp
saml/saml2/core/impl/Protocols20Impl.cpp
saml/saml2/core/impl/Protocols20SchemaValidators.cpp
saml/saml2/metadata/Metadata.h
saml/saml2/metadata/impl/AbstractMetadataProvider.cpp
saml/saml2/metadata/impl/MetadataImpl.cpp
saml/saml2/metadata/impl/MetadataSchemaValidators.cpp
samltest/saml2/core/impl/Advice20Test.h
samltest/saml2/core/impl/StatusDetail20Test.h

index 7808510..eb78774 100644 (file)
@@ -42,7 +42,7 @@ void SAML1SOAPClient::sendSAML(Request* request, const RoleDescriptor& peer, con
     Envelope* env = EnvelopeBuilder::buildEnvelope();
     Body* body = BodyBuilder::buildBody();
     env->setBody(body);
-    body->getXMLObjects().push_back(request);
+    body->getUnknownXMLObjects().push_back(request);
     try {
         send(env, peer, endpoint);
         m_correlate = XMLString::replicate(request->getRequestID());
@@ -64,7 +64,7 @@ Response* SAML1SOAPClient::receiveSAML()
         Body* body = env->getBody();
         if (body && body->hasChildren()) {
             // Check for SAML Response.
-            Response* response = dynamic_cast<Response*>(body->getXMLObjects().front());
+            Response* response = dynamic_cast<Response*>(body->getUnknownXMLObjects().front());
             if (response) {
                 
                 // Check InResponseTo.
index 10fd72f..7d854a1 100644 (file)
@@ -88,7 +88,7 @@ XMLObject* SAML1SOAPDecoder::decode(
     
     Body* body = env->getBody();
     if (body && body->hasChildren()) {
-        Request* request = dynamic_cast<Request*>(body->getXMLObjects().front());
+        Request* request = dynamic_cast<Request*>(body->getUnknownXMLObjects().front());
         if (request) {
             // Run through the policy at two layers.
             policy.evaluate(*env, &genericRequest);
index 3103651..850a077 100644 (file)
@@ -83,7 +83,7 @@ long SAML1SOAPEncoder::encode(
             Envelope* env = EnvelopeBuilder::buildEnvelope();
             Body* body = BodyBuilder::buildBody();
             env->setBody(body);
-            body->getXMLObjects().push_back(response);
+            body->getUnknownXMLObjects().push_back(response);
             if (credResolver ) {
                 if (response->getSignature()) {
                     log.debug("response already signed, skipping signature operation");
@@ -133,7 +133,7 @@ long SAML1SOAPEncoder::encode(
             Envelope* env = EnvelopeBuilder::buildEnvelope();
             Body* body = BodyBuilder::buildBody();
             env->setBody(body);
-            body->getXMLObjects().push_back(fault);
+            body->getUnknownXMLObjects().push_back(fault);
             rootElement = env->marshall();
     
             string xmlbuf;
@@ -165,7 +165,7 @@ long SAML1SOAPEncoder::encode(
         bool error =
             (env->getBody() &&
                 env->getBody()->hasChildren() &&
-                    dynamic_cast<Fault*>(env->getBody()->getXMLObjects().front()));
+                    dynamic_cast<Fault*>(env->getBody()->getUnknownXMLObjects().front()));
 
         string xmlbuf;
         XMLHelper::serialize(rootElement, xmlbuf);
index 0da3ecf..56afa7c 100644 (file)
@@ -26,7 +26,6 @@
 #include <saml/RootObject.h>
 #include <saml/util/SAMLConstants.h>
 
-#include <xmltooling/AttributeExtensibleXMLObject.h>
 #include <xmltooling/ElementProxy.h>
 #include <xmltooling/XMLObjectBuilder.h>
 #include <xmltooling/signature/KeyInfo.h>
@@ -91,7 +90,7 @@ namespace opensaml {
             static const XMLCh WIN_DOMAIN_QUALIFIED[];
         END_XMLOBJECT;
 
-        BEGIN_XMLOBJECT2(SAML_API,SubjectConfirmationData,xmltooling::ElementProxy,xmltooling::AttributeExtensibleXMLObject,SAML 1.x SubjectConfirmationData element);
+        BEGIN_XMLOBJECT(SAML_API,SubjectConfirmationData,xmltooling::ElementProxy,SAML 1.x SubjectConfirmationData element);
         END_XMLOBJECT;
         
         BEGIN_XMLOBJECT(SAML_API,SubjectConfirmation,xmltooling::XMLObject,SAML 1.x SubjectConfirmation element);
@@ -200,7 +199,7 @@ namespace opensaml {
             static const XMLCh TYPE_NAME[];
         END_XMLOBJECT;
 
-        BEGIN_XMLOBJECT2(SAML_API,AttributeValue,xmltooling::ElementProxy,xmltooling::AttributeExtensibleXMLObject,SAML 1.x AttributeValue element);
+        BEGIN_XMLOBJECT(SAML_API,AttributeValue,xmltooling::ElementProxy,SAML 1.x AttributeValue element);
         END_XMLOBJECT;
 
         BEGIN_XMLOBJECT(SAML_API,AttributeStatement,SubjectStatement,SAML 1.x AttributeStatement element);
@@ -209,10 +208,9 @@ namespace opensaml {
             static const XMLCh TYPE_NAME[];
         END_XMLOBJECT;
 
-        BEGIN_XMLOBJECT(SAML_API,Advice,xmltooling::XMLObject,SAML 1.x Advice element);
+        BEGIN_XMLOBJECT(SAML_API,Advice,xmltooling::ElementExtensibleXMLObject,SAML 1.x Advice element);
             DECL_TYPED_CHILDREN(AssertionIDReference);
             DECL_TYPED_CHILDREN(Assertion);
-            DECL_XMLOBJECT_CHILDREN(Other);
             /** AdviceType local name */
             static const XMLCh TYPE_NAME[];
         END_XMLOBJECT;
index 2201d09..0d9df87 100644 (file)
@@ -26,8 +26,6 @@
 #include <saml/RootObject.h>
 #include <saml/util/SAMLConstants.h>
 
-#include <xmltooling/AttributeExtensibleXMLObject.h>
-#include <xmltooling/ElementProxy.h>
 #include <xmltooling/XMLObjectBuilder.h>
 #include <xmltooling/signature/KeyInfo.h>
 #include <xmltooling/signature/Signature.h>
@@ -128,8 +126,7 @@ namespace opensaml {
             static xmltooling::QName VERSIONMISMATCH;
         END_XMLOBJECT;
 
-        BEGIN_XMLOBJECT(SAML_API,StatusDetail,xmltooling::XMLObject,SAML 1.x StatusDetail element);
-            DECL_XMLOBJECT_CHILDREN(Detail);
+        BEGIN_XMLOBJECT(SAML_API,StatusDetail,xmltooling::ElementExtensibleXMLObject,SAML 1.x StatusDetail element);
             /** StatusDetailType local name */
             static const XMLCh TYPE_NAME[];
         END_XMLOBJECT;
index a8127ab..8611788 100644 (file)
@@ -25,7 +25,6 @@
 #include "saml1/core/Assertions.h"
 
 #include <xmltooling/AbstractComplexElement.h>
-#include <xmltooling/AbstractElementProxy.h>
 #include <xmltooling/AbstractSimpleElement.h>
 #include <xmltooling/impl/AnyElement.h>
 #include <xmltooling/io/AbstractXMLObjectMarshaller.h>
@@ -879,7 +878,7 @@ namespace opensaml {
                             continue;
                         }
     
-                        getOthers().push_back((*i)->clone());
+                        getUnknownXMLObjects().push_back((*i)->clone());
                     }
                 }
             }
@@ -887,7 +886,7 @@ namespace opensaml {
             IMPL_XMLOBJECT_CLONE(Advice);
             IMPL_TYPED_CHILDREN(AssertionIDReference,m_children.end());
             IMPL_TYPED_CHILDREN(Assertion,m_children.end());
-            IMPL_XMLOBJECT_CHILDREN(Other,m_children.end());
+            IMPL_XMLOBJECT_CHILDREN(UnknownXMLObject,m_children.end());
     
         protected:
             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
@@ -897,7 +896,7 @@ namespace opensaml {
                 // Unknown child.
                 const XMLCh* nsURI=root->getNamespaceURI();
                 if (!XMLString::equals(nsURI,SAML1_NS) && nsURI && *nsURI) {
-                    getOthers().push_back(childXMLObject);
+                    getUnknownXMLObjects().push_back(childXMLObject);
                     return;
                 }
                 
index 2c48041..171331e 100644 (file)
@@ -137,7 +137,7 @@ namespace opensaml {
         };
 
         BEGIN_XMLOBJECTVALIDATOR(SAML_DLLLOCAL,Advice);
-            const vector<XMLObject*>& anys=ptr->getOthers();
+            const vector<XMLObject*>& anys=ptr->getUnknownXMLObjects();
             for_each(anys.begin(),anys.end(),checkWildcardNS());
         END_XMLOBJECTVALIDATOR;
 
index 550367c..2e8ec5c 100644 (file)
@@ -26,7 +26,6 @@
 #include "saml1/core/Protocols.h"
 
 #include <xmltooling/AbstractComplexElement.h>
-#include <xmltooling/AbstractElementProxy.h>
 #include <xmltooling/AbstractSimpleElement.h>
 #include <xmltooling/impl/AnyElement.h>
 #include <xmltooling/io/AbstractXMLObjectMarshaller.h>
@@ -544,20 +543,17 @@ namespace opensaml {
                 
             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);
+                getUnknownXMLObjects().push_back(childXMLObject);
             }
         };
 
index db6d1f5..e12a7d5 100644 (file)
@@ -42,7 +42,7 @@ void SAML2SOAPClient::sendSAML(RequestAbstractType* request, const RoleDescripto
     Envelope* env = EnvelopeBuilder::buildEnvelope();
     Body* body = BodyBuilder::buildBody();
     env->setBody(body);
-    body->getXMLObjects().push_back(request);
+    body->getUnknownXMLObjects().push_back(request);
     try {
         send(env, peer, endpoint);
         m_correlate = XMLString::replicate(request->getID());
@@ -64,7 +64,7 @@ StatusResponseType* SAML2SOAPClient::receiveSAML()
         Body* body = env->getBody();
         if (body && body->hasChildren()) {
             // Check for SAML Response.
-            StatusResponseType* response = dynamic_cast<StatusResponseType*>(body->getXMLObjects().front());
+            StatusResponseType* response = dynamic_cast<StatusResponseType*>(body->getUnknownXMLObjects().front());
             if (response) {
                 
                 // Check InResponseTo.
index 092e7f4..9c10638 100644 (file)
@@ -88,7 +88,7 @@ XMLObject* SAML2SOAPDecoder::decode(
     
     Body* body = env->getBody();
     if (body && body->hasChildren()) {
-        RequestAbstractType* request = dynamic_cast<RequestAbstractType*>(body->getXMLObjects().front());
+        RequestAbstractType* request = dynamic_cast<RequestAbstractType*>(body->getUnknownXMLObjects().front());
         if (request) {
             // Run through the policy at two layers.
             policy.evaluate(*env, &genericRequest);
index 3285ad7..7c407d9 100644 (file)
@@ -83,7 +83,7 @@ long SAML2SOAPEncoder::encode(
             Envelope* env = EnvelopeBuilder::buildEnvelope();
             Body* body = BodyBuilder::buildBody();
             env->setBody(body);
-            body->getXMLObjects().push_back(response);
+            body->getUnknownXMLObjects().push_back(response);
             if (credResolver ) {
                 if (response->getSignature()) {
                     log.debug("response already signed, skipping signature operation");
@@ -133,7 +133,7 @@ long SAML2SOAPEncoder::encode(
             Envelope* env = EnvelopeBuilder::buildEnvelope();
             Body* body = BodyBuilder::buildBody();
             env->setBody(body);
-            body->getXMLObjects().push_back(fault);
+            body->getUnknownXMLObjects().push_back(fault);
             rootElement = env->marshall();
     
             string xmlbuf;
@@ -165,7 +165,7 @@ long SAML2SOAPEncoder::encode(
         bool error =
             (env->getBody() &&
                 env->getBody()->hasChildren() &&
-                    dynamic_cast<Fault*>(env->getBody()->getXMLObjects().front()));
+                    dynamic_cast<Fault*>(env->getBody()->getUnknownXMLObjects().front()));
 
         string xmlbuf;
         XMLHelper::serialize(rootElement, xmlbuf);
index 512b89f..c8ec2eb 100644 (file)
@@ -26,8 +26,6 @@
 #include <saml/RootObject.h>
 #include <saml/util/SAMLConstants.h>
 
-#include <xmltooling/AttributeExtensibleXMLObject.h>
-#include <xmltooling/ElementProxy.h>
 #include <xmltooling/XMLObjectBuilder.h>
 #include <xmltooling/encryption/Encryption.h>
 #include <xmltooling/signature/KeyResolver.h>
@@ -148,7 +146,7 @@ namespace opensaml {
             static const XMLCh TYPE_NAME[];
         END_XMLOBJECT;
 
-        BEGIN_XMLOBJECT2(SAML_API,SubjectConfirmationData,xmltooling::ElementProxy,xmltooling::AttributeExtensibleXMLObject,SAML 2.0 SubjectConfirmationData element);
+        BEGIN_XMLOBJECT(SAML_API,SubjectConfirmationData,xmltooling::ElementProxy,SAML 2.0 SubjectConfirmationData element);
             DECL_DATETIME_ATTRIB(NotBefore,NOTBEFORE);
             DECL_DATETIME_ATTRIB(NotOnOrAfter,NOTONORAFTER);
             DECL_STRING_ATTRIB(Recipient,RECIPIENT);
@@ -265,7 +263,7 @@ namespace opensaml {
             static const XMLCh DECISION_INDETERMINATE[];
         END_XMLOBJECT;
 
-        BEGIN_XMLOBJECT2(SAML_API,AttributeValue,xmltooling::ElementProxy,xmltooling::AttributeExtensibleXMLObject,SAML 2.0 AttributeValue element);
+        BEGIN_XMLOBJECT(SAML_API,AttributeValue,xmltooling::ElementProxy,SAML 2.0 AttributeValue element);
         END_XMLOBJECT;
 
         BEGIN_XMLOBJECT(SAML_API,Attribute,xmltooling::AttributeExtensibleXMLObject,SAML 2.0 Attribute element);
@@ -296,12 +294,11 @@ namespace opensaml {
         BEGIN_XMLOBJECT(SAML_API,EncryptedAssertion,EncryptedElementType,SAML 2.0 EncryptedAssertion element);
         END_XMLOBJECT;
 
-        BEGIN_XMLOBJECT(SAML_API,Advice,xmltooling::XMLObject,SAML 2.0 Advice element);
+        BEGIN_XMLOBJECT(SAML_API,Advice,xmltooling::ElementExtensibleXMLObject,SAML 2.0 Advice element);
             DECL_TYPED_CHILDREN(AssertionIDRef);
             DECL_TYPED_CHILDREN(AssertionURIRef);
             DECL_TYPED_CHILDREN(Assertion);
             DECL_TYPED_CHILDREN(EncryptedAssertion);
-            DECL_XMLOBJECT_CHILDREN(Other);
             /** AdviceType local name */
             static const XMLCh TYPE_NAME[];
         END_XMLOBJECT;
index c93c758..fa8360c 100644 (file)
@@ -45,7 +45,7 @@ namespace opensaml {
 
         DECL_XMLOBJECT_SIMPLE(SAML_API,RespondTo,Name,SAML 2.0 third-party request RespondTo extension element);
 
-        BEGIN_XMLOBJECT(SAML_API,Extensions,xmltooling::ElementProxy,SAML 2.0 protocol Extensions element);
+        BEGIN_XMLOBJECT(SAML_API,Extensions,xmltooling::ElementExtensibleXMLObject,SAML 2.0 protocol Extensions element);
             /** ExtensionsType local name */
             static const XMLCh TYPE_NAME[];
         END_XMLOBJECT;
@@ -126,8 +126,7 @@ namespace opensaml {
             /*@{*/
         END_XMLOBJECT;
 
-        BEGIN_XMLOBJECT(SAML_API,StatusDetail,xmltooling::XMLObject,SAML 2.0 StatusDetail element);
-            DECL_XMLOBJECT_CHILDREN(Detail);
+        BEGIN_XMLOBJECT(SAML_API,StatusDetail,xmltooling::ElementExtensibleXMLObject,SAML 2.0 StatusDetail element);
             /** StatusDetailType local name */
             static const XMLCh TYPE_NAME[];
         END_XMLOBJECT;
index d570aba..7535d78 100644 (file)
@@ -26,7 +26,6 @@
 #include "saml2/core/Assertions.h"
 
 #include <xmltooling/AbstractComplexElement.h>
-#include <xmltooling/AbstractElementProxy.h>
 #include <xmltooling/AbstractSimpleElement.h>
 #include <xmltooling/encryption/Decrypter.h>
 #include <xmltooling/impl/AnyElement.h>
@@ -546,11 +545,8 @@ namespace opensaml {
                 setInResponseTo(src.getInResponseTo());
                 setAddress(src.getAddress());
                 VectorOf(KeyInfo) v=getKeyInfos();
-                for (vector<KeyInfo*>::const_iterator i=src.m_KeyInfos.begin(); i!=src.m_KeyInfos.end(); i++) {
-                    if (*i) {
-                        v.push_back((*i)->cloneKeyInfo());
-                    }
-                }
+                for (vector<KeyInfo*>::const_iterator i=src.m_KeyInfos.begin(); i!=src.m_KeyInfos.end(); ++i)
+                    v.push_back((*i)->cloneKeyInfo());
             }
             
             IMPL_XMLOBJECT_CLONE(KeyInfoConfirmationDataType);
@@ -1301,7 +1297,7 @@ namespace opensaml {
                             continue;
                         }
 
-                        getOthers().push_back((*i)->clone());
+                        getUnknownXMLObjects().push_back((*i)->clone());
                     }
                 }
             }
@@ -1311,7 +1307,7 @@ namespace opensaml {
             IMPL_TYPED_CHILDREN(AssertionURIRef,m_children.end());
             IMPL_TYPED_CHILDREN(Assertion,m_children.end());
             IMPL_TYPED_CHILDREN(EncryptedAssertion,m_children.end());
-            IMPL_XMLOBJECT_CHILDREN(Other,m_children.end());
+            IMPL_XMLOBJECT_CHILDREN(UnknownXMLObject,m_children.end());
     
         protected:
             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
@@ -1323,7 +1319,7 @@ namespace opensaml {
                 // Unknown child.
                 const XMLCh* nsURI=root->getNamespaceURI();
                 if (!XMLString::equals(nsURI,SAML20_NS) && nsURI && *nsURI) {
-                    getOthers().push_back(childXMLObject);
+                    getUnknownXMLObjects().push_back(childXMLObject);
                     return;
                 }
                 
index 2d47a27..d979396 100644 (file)
@@ -172,7 +172,7 @@ namespace opensaml {
         };
 
         BEGIN_XMLOBJECTVALIDATOR(SAML_DLLLOCAL,Advice);
-            const vector<XMLObject*>& anys=ptr->getOthers();
+            const vector<XMLObject*>& anys=ptr->getUnknownXMLObjects();
             for_each(anys.begin(),anys.end(),checkWildcardNS());
         END_XMLOBJECTVALIDATOR;
 
index fa407d8..4db1cba 100644 (file)
@@ -26,7 +26,6 @@
 #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>
@@ -69,7 +68,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
@@ -82,22 +81,21 @@ namespace opensaml {
             }
                 
             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,SAML20P_NS) && nsURI && *nsURI) {
-                    getXMLObjects().push_back(childXMLObject);
+                    getUnknownXMLObjects().push_back(childXMLObject);
                     return;
                 }
                 
@@ -169,21 +167,17 @@ namespace opensaml {
 
                 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);
                 }
         };
 
index 109f518..42cb5b7 100644 (file)
@@ -85,7 +85,7 @@ namespace opensaml {
         BEGIN_XMLOBJECTVALIDATOR(SAML_DLLLOCAL,Extensions);
             if (!ptr->hasChildren())
                 throw ValidationException("Extensions must have at least one child element.");
-            const list<XMLObject*>& anys=ptr->getXMLObjects();
+            const vector<XMLObject*>& anys=ptr->getUnknownXMLObjects();
             for_each(anys.begin(),anys.end(),checkWildcardNS());
         END_XMLOBJECTVALIDATOR;
 
index 7b995a0..7f5f97f 100644 (file)
@@ -103,7 +103,7 @@ namespace opensaml {
             DECL_SIMPLE_CONTENT(URL);
         END_XMLOBJECT;
         
-        BEGIN_XMLOBJECT(SAML_API,Extensions,xmltooling::ElementProxy,SAML 2.0 Extensions element);
+        BEGIN_XMLOBJECT(SAML_API,Extensions,xmltooling::ElementExtensibleXMLObject,SAML 2.0 Extensions element);
             /** ExtensionsType local name */
             static const XMLCh TYPE_NAME[];
         END_XMLOBJECT;
@@ -173,7 +173,7 @@ namespace opensaml {
             DECL_TYPED_CHILDREN(ContactPerson);
         END_XMLOBJECT;
 
-        BEGIN_XMLOBJECT2(SAML_API,EndpointType,xmltooling::ElementProxy,xmltooling::AttributeExtensibleXMLObject,SAML 2.0 EndpointType type);
+        BEGIN_XMLOBJECT(SAML_API,EndpointType,xmltooling::ElementProxy,SAML 2.0 EndpointType type);
             DECL_STRING_ATTRIB(Binding,BINDING);
             DECL_STRING_ATTRIB(Location,LOCATION);
             DECL_STRING_ATTRIB(ResponseLocation,RESPONSELOCATION);
index e113094..46e4297 100644 (file)
@@ -83,9 +83,9 @@ void AbstractMetadataProvider::index(EntityDescriptor* site, time_t validUntil)
         if ((*i)->hasSupport(samlconstants::SAML10_PROTOCOL_ENUM) || (*i)->hasSupport(samlconstants::SAML11_PROTOCOL_ENUM)) {
             // Check for SourceID extension element.
             const Extensions* exts=(*i)->getExtensions();
-            if (exts) {
-                const list<XMLObject*>& children=exts->getXMLObjects();
-                for (list<XMLObject*>::const_iterator ext=children.begin(); ext!=children.end(); ext++) {
+            if (exts && exts->hasChildren()) {
+                const vector<XMLObject*>& children=exts->getUnknownXMLObjects();
+                for (vector<XMLObject*>::const_iterator ext=children.begin(); ext!=children.end(); ++ext) {
                     SourceID* sid=dynamic_cast<SourceID*>(*ext);
                     if (sid) {
                         auto_ptr_char sourceid(sid->getID());
index d2fea81..525a93e 100644 (file)
@@ -26,7 +26,6 @@
 #include "saml2/metadata/MetadataKeyInfoIterator.h"
 
 #include <xmltooling/AbstractComplexElement.h>
-#include <xmltooling/AbstractElementProxy.h>
 #include <xmltooling/AbstractSimpleElement.h>
 #include <xmltooling/impl/AnyElement.h>
 #include <xmltooling/io/AbstractXMLObjectMarshaller.h>
@@ -239,7 +238,7 @@ namespace opensaml {
         };
 
         class SAML_DLLLOCAL ExtensionsImpl : public virtual Extensions,
-            public AbstractElementProxy,
+            public AbstractComplexElement,
             public AbstractDOMCachingXMLObject,
             public AbstractXMLObjectMarshaller,
             public AbstractXMLObjectUnmarshaller
@@ -252,22 +251,21 @@ namespace opensaml {
             }
                 
             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,SAML20MD_NS) && nsURI && *nsURI) {
-                    getXMLObjects().push_back(childXMLObject);
+                    getUnknownXMLObjects().push_back(childXMLObject);
                     return;
                 }
                 
@@ -557,8 +555,8 @@ namespace opensaml {
         };
 
         class SAML_DLLLOCAL EndpointTypeImpl : public virtual EndpointType,
-            public AbstractElementProxy,
             public AbstractAttributeExtensibleXMLObject,
+            public AbstractComplexElement,
             public AbstractDOMCachingXMLObject,
             public AbstractXMLObjectMarshaller,
             public AbstractXMLObjectUnmarshaller
@@ -584,22 +582,23 @@ namespace opensaml {
             }
                 
             EndpointTypeImpl(const EndpointTypeImpl& src)
-                    : AbstractXMLObject(src), AbstractElementProxy(src),
-                        AbstractAttributeExtensibleXMLObject(src), AbstractDOMCachingXMLObject(src) {
+                    : AbstractXMLObject(src),
+                        AbstractAttributeExtensibleXMLObject(src),
+                        AbstractComplexElement(src),
+                        AbstractDOMCachingXMLObject(src) {
                 setBinding(src.getBinding());
                 setLocation(src.getLocation());
                 setResponseLocation(src.getResponseLocation());
-                for (list<XMLObject*>::const_iterator i=src.m_children.begin(); i!=src.m_children.end(); i++) {
-                    if (*i) {
-                        getXMLObjects().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(EndpointType);
             IMPL_STRING_ATTRIB(Binding);
             IMPL_STRING_ATTRIB(Location);
             IMPL_STRING_ATTRIB(ResponseLocation);
+            IMPL_XMLOBJECT_CHILDREN(UnknownXMLObject,m_children.end());
     
             void setAttribute(const QName& qualifiedName, const XMLCh* value, bool ID=false) {
                 if (!qualifiedName.hasNamespaceURI()) {
@@ -630,7 +629,7 @@ namespace opensaml {
                 // Unknown child.
                 const XMLCh* nsURI=root->getNamespaceURI();
                 if (!XMLString::equals(nsURI,SAML20MD_NS) && nsURI && *nsURI) {
-                    getXMLObjects().push_back(childXMLObject);
+                    getUnknownXMLObjects().push_back(childXMLObject);
                     return;
                 }
                 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
index 179dd76..e954d21 100644 (file)
@@ -86,7 +86,7 @@ namespace opensaml {
         BEGIN_XMLOBJECTVALIDATOR(SAML_DLLLOCAL,Extensions);
             if (!ptr->hasChildren())
                 throw ValidationException("Extensions must have at least one child element.");
-            const list<XMLObject*>& anys=ptr->getXMLObjects();
+            const vector<XMLObject*>& anys=ptr->getUnknownXMLObjects();
             for_each(anys.begin(),anys.end(),checkWildcardNS());
         END_XMLOBJECTVALIDATOR;
         
@@ -127,7 +127,7 @@ namespace opensaml {
         BEGIN_XMLOBJECTVALIDATOR(SAML_DLLLOCAL,EndpointType);
             XMLOBJECTVALIDATOR_REQUIRE(EndpointType,Binding);
             XMLOBJECTVALIDATOR_REQUIRE(EndpointType,Location);
-            const list<XMLObject*>& anys=ptr->getXMLObjects();
+            const vector<XMLObject*>& anys=ptr->getUnknownXMLObjects();
             for_each(anys.begin(),anys.end(),checkWildcardNS());
         END_XMLOBJECTVALIDATOR;
 
index 8aed1a2..af33835 100644 (file)
@@ -44,7 +44,7 @@ public:
         TSM_ASSERT_EQUALS("# of AssertionURIRef child elements", 0, advice->getAssertionURIRefs().size());
         TSM_ASSERT_EQUALS("# of Assertion child elements", 0, advice->getAssertions().size());
         TSM_ASSERT_EQUALS("# of EncryptedAssertion child elements", 0, advice->getEncryptedAssertions().size());
-        TSM_ASSERT_EQUALS("# of Other child elements", 0, advice->getOthers().size());
+        TSM_ASSERT_EQUALS("# of Other child elements", 0, advice->getUnknownXMLObjects().size());
     }
 
     void testChildElementsUnmarshall() {
@@ -56,7 +56,7 @@ public:
         TSM_ASSERT_EQUALS("# of AssertionURIRef child elements", 2, advice->getAssertionURIRefs().size());
         TSM_ASSERT_EQUALS("# of Assertion child elements", 2, advice->getAssertions().size());
         TSM_ASSERT_EQUALS("# of EncryptedAssertion child elements", 1, advice->getEncryptedAssertions().size());
-        TSM_ASSERT_EQUALS("# of Other child elements", 0, advice->getOthers().size());
+        TSM_ASSERT_EQUALS("# of Other child elements", 0, advice->getUnknownXMLObjects().size());
     }
 
     void testSingleElementMarshall() {
index f31544c..df9805d 100644 (file)
@@ -36,7 +36,7 @@ public:
         auto_ptr<XMLObject> xo(unmarshallElement(singleElementFile));
         StatusDetail* sd= dynamic_cast<StatusDetail*>(xo.get());
         TS_ASSERT(sd!=NULL);
-        TSM_ASSERT_EQUALS("StatusDetail child elements", sd->getDetails().size(), 0);
+        TSM_ASSERT_EQUALS("StatusDetail child elements", sd->getUnknownXMLObjects().size(), 0);
     }
 
     //TODO test with some XMLObject child elements from another namespace
@@ -44,7 +44,7 @@ public:
         auto_ptr<XMLObject> xo(unmarshallElement(childElementsFile));
         StatusDetail* sd= dynamic_cast<StatusDetail*>(xo.get());
         TS_ASSERT(sd!=NULL);
-        TSM_ASSERT_EQUALS("StatusDetail child elements", sd->getDetails().size(), 3);
+        TSM_ASSERT_EQUALS("StatusDetail child elements", sd->getUnknownXMLObjects().size(), 3);
     }
 
     void testSingleElementMarshall() {