958094aba239bb1df8b6db5b9a30f13a37597b89
[shibboleth/cpp-opensaml.git] / saml / saml2 / metadata / impl / MetadataImpl.cpp
1 /*
2  *  Copyright 2001-2010 Internet2
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 /**
18  * MetadataImpl.cpp
19  *
20  * Implementation classes for SAML 2.0 Metadata schema.
21  */
22
23 #include "internal.h"
24 #include "exceptions.h"
25 #include "saml2/metadata/Metadata.h"
26 #include "signature/ContentReference.h"
27
28 #include <xmltooling/AbstractComplexElement.h>
29 #include <xmltooling/AbstractSimpleElement.h>
30 #include <xmltooling/encryption/Encryption.h>
31 #include <xmltooling/impl/AnyElement.h>
32 #include <xmltooling/io/AbstractXMLObjectMarshaller.h>
33 #include <xmltooling/io/AbstractXMLObjectUnmarshaller.h>
34 #include <xmltooling/signature/KeyInfo.h>
35 #include <xmltooling/signature/Signature.h>
36 #include <xmltooling/util/DateTime.h>
37 #include <xmltooling/util/XMLHelper.h>
38
39 #include <ctime>
40 #include <xercesc/util/XMLUniDefs.hpp>
41 #include <xsec/framework/XSECDefs.hpp>
42
43 using namespace samlconstants;
44 using namespace opensaml::saml2md;
45 using namespace opensaml::saml2;
46 using namespace xmlencryption;
47 using namespace xmlsignature;
48 using namespace xmltooling;
49 using namespace std;
50 using xmlconstants::XMLSIG_NS;
51 using xmlconstants::XML_BOOL_NULL;
52
53 #if defined (_MSC_VER)
54     #pragma warning( push )
55     #pragma warning( disable : 4250 4251 )
56 #endif
57
58 namespace opensaml {
59     namespace saml2md {
60
61         DECL_XMLOBJECTIMPL_SIMPLE(SAML_DLLLOCAL,AffiliateMember);
62         DECL_XMLOBJECTIMPL_SIMPLE(SAML_DLLLOCAL,AttributeProfile);
63         DECL_XMLOBJECTIMPL_SIMPLE(SAML_DLLLOCAL,Company);
64         DECL_XMLOBJECTIMPL_SIMPLE(SAML_DLLLOCAL,EmailAddress);
65         DECL_XMLOBJECTIMPL_SIMPLE(SAML_DLLLOCAL,GivenName);
66         DECL_XMLOBJECTIMPL_SIMPLE(SAML_DLLLOCAL,NameIDFormat);
67         DECL_XMLOBJECTIMPL_SIMPLE(SAML_DLLLOCAL,SurName);
68         DECL_XMLOBJECTIMPL_SIMPLE(SAML_DLLLOCAL,TelephoneNumber);
69
70         DECL_XMLOBJECTIMPL_SIMPLE(SAML_DLLLOCAL,ActionNamespace);
71         DECL_XMLOBJECTIMPL_SIMPLE(SAML_DLLLOCAL,SourceID);
72
73         class SAML_DLLLOCAL localizedNameTypeImpl : public virtual localizedNameType,
74             public AbstractSimpleElement,
75             public AbstractDOMCachingXMLObject,
76             public AbstractXMLObjectMarshaller,
77             public AbstractXMLObjectUnmarshaller
78         {
79             void init() {
80                 m_Lang=nullptr;
81                 m_LangPrefix=nullptr;
82             }
83
84         protected:
85             localizedNameTypeImpl() {
86                 init();
87             }
88
89         public:
90             virtual ~localizedNameTypeImpl() {
91                 XMLString::release(&m_Lang);
92                 XMLString::release(&m_LangPrefix);
93             }
94
95             localizedNameTypeImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
96                     : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
97                 init();
98             }
99
100             localizedNameTypeImpl(const localizedNameTypeImpl& src)
101                     : AbstractXMLObject(src), AbstractSimpleElement(src), AbstractDOMCachingXMLObject(src) {
102                 init();
103                 setLang(src.getLang());
104                 if (src.m_LangPrefix)
105                     m_LangPrefix = XMLString::replicate(src.m_LangPrefix);
106             }
107
108             IMPL_XMLOBJECT_CLONE(localizedNameType);
109             IMPL_XMLOBJECT_FOREIGN_ATTRIB(Lang,XMLCh);
110
111         protected:
112             void marshallAttributes(DOMElement* domElement) const {
113                 if (m_Lang && *m_Lang) {
114                     DOMAttr* attr=domElement->getOwnerDocument()->createAttributeNS(xmlconstants::XML_NS,LANG_ATTRIB_NAME);
115                     if (m_LangPrefix && *m_LangPrefix)
116                         attr->setPrefix(m_LangPrefix);
117                     attr->setNodeValue(m_Lang);
118                     domElement->setAttributeNodeNS(attr);
119                 }
120             }
121
122             void processAttribute(const DOMAttr* attribute) {
123                 if (XMLHelper::isNodeNamed(attribute, xmlconstants::XML_NS, LANG_ATTRIB_NAME)) {
124                     setLang(attribute->getValue());
125                     const XMLCh* temp = attribute->getPrefix();
126                     if (temp && *temp && !XMLString::equals(temp, xmlconstants::XML_NS))
127                         m_LangPrefix = XMLString::replicate(temp);
128                     return;
129                 }
130                 AbstractXMLObjectUnmarshaller::processAttribute(attribute);
131             }
132         };
133
134         class SAML_DLLLOCAL localizedURITypeImpl : public virtual localizedURIType,
135             public AbstractSimpleElement,
136             public AbstractDOMCachingXMLObject,
137             public AbstractXMLObjectMarshaller,
138             public AbstractXMLObjectUnmarshaller
139         {
140             void init() {
141                 m_Lang=nullptr;
142                 m_LangPrefix=nullptr;
143             }
144
145         protected:
146             localizedURITypeImpl() {
147                 init();
148             }
149
150         public:
151             virtual ~localizedURITypeImpl() {
152                 XMLString::release(&m_Lang);
153                 XMLString::release(&m_LangPrefix);
154             }
155
156             localizedURITypeImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
157                     : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
158                 init();
159             }
160
161             localizedURITypeImpl(const localizedURITypeImpl& src)
162                     : AbstractXMLObject(src), AbstractSimpleElement(src), AbstractDOMCachingXMLObject(src) {
163                 init();
164                 setLang(src.getLang());
165                 if (src.m_LangPrefix)
166                     m_LangPrefix = XMLString::replicate(src.m_LangPrefix);
167             }
168
169             IMPL_XMLOBJECT_CLONE(localizedURIType);
170             IMPL_XMLOBJECT_FOREIGN_ATTRIB(Lang,XMLCh);
171
172         protected:
173             void marshallAttributes(DOMElement* domElement) const {
174                 if (m_Lang && *m_Lang) {
175                     DOMAttr* attr=domElement->getOwnerDocument()->createAttributeNS(xmlconstants::XML_NS,LANG_ATTRIB_NAME);
176                     if (m_LangPrefix && *m_LangPrefix)
177                         attr->setPrefix(m_LangPrefix);
178                     attr->setNodeValue(m_Lang);
179                     domElement->setAttributeNodeNS(attr);
180                 }
181             }
182
183             void processAttribute(const DOMAttr* attribute) {
184                 if (XMLHelper::isNodeNamed(attribute, xmlconstants::XML_NS, LANG_ATTRIB_NAME)) {
185                     setLang(attribute->getValue());
186                     const XMLCh* temp = attribute->getPrefix();
187                     if (temp && *temp && !XMLString::equals(temp, xmlconstants::XML_NS))
188                         m_LangPrefix = XMLString::replicate(temp);
189                     return;
190                 }
191                 AbstractXMLObjectUnmarshaller::processAttribute(attribute);
192             }
193         };
194
195         class SAML_DLLLOCAL OrganizationNameImpl : public virtual OrganizationName, public localizedNameTypeImpl
196         {
197         public:
198             virtual ~OrganizationNameImpl() {}
199
200             OrganizationNameImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
201                 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {}
202
203             OrganizationNameImpl(const OrganizationNameImpl& src) : AbstractXMLObject(src), localizedNameTypeImpl(src) {}
204
205             IMPL_XMLOBJECT_CLONE(OrganizationName);
206             localizedNameType* clonelocalizedNameType() const {
207                 return new OrganizationNameImpl(*this);
208             }
209         };
210
211         class SAML_DLLLOCAL OrganizationDisplayNameImpl : public virtual OrganizationDisplayName, public localizedNameTypeImpl
212         {
213         public:
214             virtual ~OrganizationDisplayNameImpl() {}
215
216             OrganizationDisplayNameImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
217                 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {}
218
219             OrganizationDisplayNameImpl(const OrganizationDisplayNameImpl& src) : AbstractXMLObject(src), localizedNameTypeImpl(src) {}
220
221             IMPL_XMLOBJECT_CLONE(OrganizationDisplayName);
222             localizedNameType* clonelocalizedNameType() const {
223                 return new OrganizationDisplayNameImpl(*this);
224             }
225         };
226
227         class SAML_DLLLOCAL OrganizationURLImpl : public virtual OrganizationURL, public localizedURITypeImpl
228         {
229         public:
230             virtual ~OrganizationURLImpl() {}
231
232             OrganizationURLImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
233                 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {}
234
235             OrganizationURLImpl(const OrganizationURLImpl& src) : AbstractXMLObject(src), localizedURITypeImpl(src) {}
236
237             IMPL_XMLOBJECT_CLONE(OrganizationURL);
238             localizedURIType* clonelocalizedURIType() const {
239                 return new OrganizationURLImpl(*this);
240             }
241         };
242
243         class SAML_DLLLOCAL ServiceNameImpl : public virtual ServiceName, public localizedNameTypeImpl
244         {
245         public:
246             virtual ~ServiceNameImpl() {}
247
248             ServiceNameImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
249                 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {}
250
251             ServiceNameImpl(const ServiceNameImpl& src) : AbstractXMLObject(src), localizedNameTypeImpl(src) {}
252
253             IMPL_XMLOBJECT_CLONE(ServiceName);
254             localizedNameType* clonelocalizedNameType() const {
255                 return new ServiceNameImpl(*this);
256             }
257         };
258
259         class SAML_DLLLOCAL ServiceDescriptionImpl : public virtual ServiceDescription, public localizedNameTypeImpl
260         {
261         public:
262             virtual ~ServiceDescriptionImpl() {}
263
264             ServiceDescriptionImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
265                 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {}
266
267             ServiceDescriptionImpl(const ServiceDescriptionImpl& src) : AbstractXMLObject(src), localizedNameTypeImpl(src) {}
268
269             IMPL_XMLOBJECT_CLONE(ServiceDescription);
270             localizedNameType* clonelocalizedNameType() const {
271                 return new ServiceDescriptionImpl(*this);
272             }
273         };
274
275         class SAML_DLLLOCAL ExtensionsImpl : public virtual Extensions,
276             public AbstractComplexElement,
277             public AbstractDOMCachingXMLObject,
278             public AbstractXMLObjectMarshaller,
279             public AbstractXMLObjectUnmarshaller
280         {
281         public:
282             virtual ~ExtensionsImpl() {}
283
284             ExtensionsImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
285                 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
286             }
287
288             ExtensionsImpl(const ExtensionsImpl& src)
289                     : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
290                 VectorOf(XMLObject) v=getUnknownXMLObjects();
291                 for (vector<XMLObject*>::const_iterator i=src.m_UnknownXMLObjects.begin(); i!=src.m_UnknownXMLObjects.end(); ++i)
292                     v.push_back((*i)->clone());
293             }
294
295             IMPL_XMLOBJECT_CLONE(Extensions);
296             IMPL_XMLOBJECT_CHILDREN(UnknownXMLObject,m_children.end());
297
298         protected:
299             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
300                 // Unknown child.
301                 const XMLCh* nsURI=root->getNamespaceURI();
302                 if (!XMLString::equals(nsURI,SAML20MD_NS) && nsURI && *nsURI) {
303                     getUnknownXMLObjects().push_back(childXMLObject);
304                     return;
305                 }
306
307                 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
308             }
309         };
310
311         class SAML_DLLLOCAL OrganizationImpl : public virtual Organization,
312             public AbstractComplexElement,
313             public AbstractAttributeExtensibleXMLObject,
314             public AbstractDOMCachingXMLObject,
315             public AbstractXMLObjectMarshaller,
316             public AbstractXMLObjectUnmarshaller
317         {
318             list<XMLObject*>::iterator m_pos_OrganizationDisplayName;
319             list<XMLObject*>::iterator m_pos_OrganizationURL;
320
321             void init() {
322                 m_children.push_back(nullptr);
323                 m_children.push_back(nullptr);
324                 m_children.push_back(nullptr);
325                 m_Extensions=nullptr;
326                 m_pos_Extensions=m_children.begin();
327                 m_pos_OrganizationDisplayName=m_pos_Extensions;
328                 ++m_pos_OrganizationDisplayName;
329                 m_pos_OrganizationURL=m_pos_OrganizationDisplayName;
330                 ++m_pos_OrganizationURL;
331             }
332         public:
333             virtual ~OrganizationImpl() {}
334
335             OrganizationImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
336                 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
337                 init();
338             }
339
340             OrganizationImpl(const OrganizationImpl& src)
341                     : AbstractXMLObject(src), AbstractComplexElement(src),
342                         AbstractAttributeExtensibleXMLObject(src), AbstractDOMCachingXMLObject(src) {
343                 init();
344                 if (src.getExtensions())
345                     setExtensions(src.getExtensions()->cloneExtensions());
346                 VectorOf(OrganizationName) v=getOrganizationNames();
347                 for (vector<OrganizationName*>::const_iterator i=src.m_OrganizationNames.begin(); i!=src.m_OrganizationNames.end(); i++) {
348                     if (*i) {
349                         v.push_back((*i)->cloneOrganizationName());
350                     }
351                 }
352                 VectorOf(OrganizationDisplayName) w=getOrganizationDisplayNames();
353                 for (vector<OrganizationDisplayName*>::const_iterator j=src.m_OrganizationDisplayNames.begin(); j!=src.m_OrganizationDisplayNames.end(); j++) {
354                     if (*j) {
355                         w.push_back((*j)->cloneOrganizationDisplayName());
356                     }
357                 }
358                 VectorOf(OrganizationURL) x=getOrganizationURLs();
359                 for (vector<OrganizationURL*>::const_iterator k=src.m_OrganizationURLs.begin(); k!=src.m_OrganizationURLs.end(); k++) {
360                     if (*k) {
361                         x.push_back((*k)->cloneOrganizationURL());
362                     }
363                 }
364             }
365
366             IMPL_XMLOBJECT_CLONE(Organization);
367             IMPL_TYPED_CHILD(Extensions);
368             IMPL_TYPED_CHILDREN(OrganizationName,m_pos_OrganizationDisplayName);
369             IMPL_TYPED_CHILDREN(OrganizationDisplayName,m_pos_OrganizationURL);
370             IMPL_TYPED_CHILDREN(OrganizationURL,m_children.end());
371
372         protected:
373             void marshallAttributes(DOMElement* domElement) const {
374                 marshallExtensionAttributes(domElement);
375             }
376
377             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
378                 PROC_TYPED_CHILD(Extensions,SAML20MD_NS,false);
379                 PROC_TYPED_CHILDREN(OrganizationName,SAML20MD_NS,false);
380                 PROC_TYPED_CHILDREN(OrganizationDisplayName,SAML20MD_NS,false);
381                 PROC_TYPED_CHILDREN(OrganizationURL,SAML20MD_NS,false);
382                 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
383             }
384
385             void processAttribute(const DOMAttr* attribute) {
386                 unmarshallExtensionAttribute(attribute);
387             }
388         };
389
390         class SAML_DLLLOCAL ContactPersonImpl : public virtual ContactPerson,
391             public AbstractComplexElement,
392             public AbstractAttributeExtensibleXMLObject,
393             public AbstractDOMCachingXMLObject,
394             public AbstractXMLObjectMarshaller,
395             public AbstractXMLObjectUnmarshaller
396         {
397             list<XMLObject*>::iterator m_pos_TelephoneNumber;
398
399             void init() {
400                 m_ContactType=nullptr;
401                 m_children.push_back(nullptr);
402                 m_children.push_back(nullptr);
403                 m_children.push_back(nullptr);
404                 m_children.push_back(nullptr);
405                 m_children.push_back(nullptr);
406                 m_Extensions=nullptr;
407                 m_Company=nullptr;
408                 m_GivenName=nullptr;
409                 m_SurName=nullptr;
410                 m_pos_Extensions=m_children.begin();
411                 m_pos_Company=m_pos_Extensions;
412                 ++m_pos_Company;
413                 m_pos_GivenName=m_pos_Company;
414                 ++m_pos_GivenName;
415                 m_pos_SurName=m_pos_GivenName;
416                 ++m_pos_SurName;
417                 m_pos_TelephoneNumber=m_pos_SurName;
418                 ++m_pos_TelephoneNumber;
419             }
420         public:
421             virtual ~ContactPersonImpl() {
422                 XMLString::release(&m_ContactType);
423             }
424
425             ContactPersonImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
426                 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
427                 init();
428             }
429
430             ContactPersonImpl(const ContactPersonImpl& src)
431                     : AbstractXMLObject(src), AbstractComplexElement(src),
432                         AbstractAttributeExtensibleXMLObject(src), AbstractDOMCachingXMLObject(src) {
433                 init();
434                 if (src.getExtensions())
435                     setExtensions(src.getExtensions()->cloneExtensions());
436                 if (src.getCompany())
437                     setCompany(src.getCompany()->cloneCompany());
438                 if (src.getGivenName())
439                     setGivenName(src.getGivenName()->cloneGivenName());
440                 if (src.getSurName())
441                     setSurName(src.getSurName()->cloneSurName());
442
443                 VectorOf(EmailAddress) v=getEmailAddresss();
444                 for (vector<EmailAddress*>::const_iterator i=src.m_EmailAddresss.begin(); i!=src.m_EmailAddresss.end(); i++) {
445                     if (*i) {
446                         v.push_back((*i)->cloneEmailAddress());
447                     }
448                 }
449                 VectorOf(TelephoneNumber) w=getTelephoneNumbers();
450                 for (vector<TelephoneNumber*>::const_iterator j=src.m_TelephoneNumbers.begin(); j!=src.m_TelephoneNumbers.end(); j++) {
451                     if (*j) {
452                         w.push_back((*j)->cloneTelephoneNumber());
453                     }
454                 }
455             }
456
457             IMPL_XMLOBJECT_CLONE(ContactPerson);
458             IMPL_STRING_ATTRIB(ContactType);
459             IMPL_TYPED_CHILD(Extensions);
460             IMPL_TYPED_CHILD(Company);
461             IMPL_TYPED_CHILD(GivenName);
462             IMPL_TYPED_CHILD(SurName);
463             IMPL_TYPED_CHILDREN(EmailAddress,m_pos_TelephoneNumber);
464             IMPL_TYPED_CHILDREN(TelephoneNumber,m_children.end());
465
466             void setAttribute(const xmltooling::QName& qualifiedName, const XMLCh* value, bool ID=false) {
467                 if (!qualifiedName.hasNamespaceURI()) {
468                     if (XMLString::equals(qualifiedName.getLocalPart(),CONTACTTYPE_ATTRIB_NAME)) {
469                         setContactType(value);
470                         return;
471                     }
472                 }
473                 AbstractAttributeExtensibleXMLObject::setAttribute(qualifiedName, value, ID);
474             }
475
476         protected:
477             void marshallAttributes(DOMElement* domElement) const {
478                 MARSHALL_STRING_ATTRIB(ContactType,CONTACTTYPE,nullptr);
479                 marshallExtensionAttributes(domElement);
480             }
481
482             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
483                 PROC_TYPED_CHILD(Extensions,SAML20MD_NS,false);
484                 PROC_TYPED_CHILD(Company,SAML20MD_NS,false);
485                 PROC_TYPED_CHILD(GivenName,SAML20MD_NS,false);
486                 PROC_TYPED_CHILD(SurName,SAML20MD_NS,false);
487                 PROC_TYPED_CHILDREN(EmailAddress,SAML20MD_NS,false);
488                 PROC_TYPED_CHILDREN(TelephoneNumber,SAML20MD_NS,false);
489                 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
490             }
491
492             void processAttribute(const DOMAttr* attribute) {
493                 unmarshallExtensionAttribute(attribute);
494             }
495         };
496
497         class SAML_DLLLOCAL AdditionalMetadataLocationImpl : public virtual AdditionalMetadataLocation,
498             public AbstractSimpleElement,
499             public AbstractDOMCachingXMLObject,
500             public AbstractXMLObjectMarshaller,
501             public AbstractXMLObjectUnmarshaller
502         {
503             void init() {
504                 m_Namespace=nullptr;
505             }
506
507         public:
508             virtual ~AdditionalMetadataLocationImpl() {
509                 XMLString::release(&m_Namespace);
510             }
511
512             AdditionalMetadataLocationImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
513                     : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
514                 init();
515             }
516
517             AdditionalMetadataLocationImpl(const AdditionalMetadataLocationImpl& src)
518                     : AbstractXMLObject(src), AbstractSimpleElement(src), AbstractDOMCachingXMLObject(src) {
519                 init();
520             }
521
522             IMPL_XMLOBJECT_CLONE(AdditionalMetadataLocation);
523             IMPL_STRING_ATTRIB(Namespace);
524
525         protected:
526             void marshallAttributes(DOMElement* domElement) const {
527                 MARSHALL_STRING_ATTRIB(Namespace,NAMESPACE,nullptr);
528             }
529
530             void processAttribute(const DOMAttr* attribute) {
531                 PROC_STRING_ATTRIB(Namespace,NAMESPACE,nullptr);
532                 AbstractXMLObjectUnmarshaller::processAttribute(attribute);
533             }
534         };
535
536         class SAML_DLLLOCAL KeyDescriptorImpl : public virtual KeyDescriptor,
537             public AbstractComplexElement,
538             public AbstractDOMCachingXMLObject,
539             public AbstractXMLObjectMarshaller,
540             public AbstractXMLObjectUnmarshaller
541         {
542                 void init() {
543                 m_Use=nullptr;
544                 m_KeyInfo=nullptr;
545                 m_children.push_back(nullptr);
546                 m_pos_KeyInfo=m_children.begin();
547             }
548         public:
549             virtual ~KeyDescriptorImpl() {
550                 XMLString::release(&m_Use);
551             }
552
553             KeyDescriptorImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
554                 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
555                 init();
556             }
557
558             KeyDescriptorImpl(const KeyDescriptorImpl& src)
559                     : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
560                 init();
561                 setUse(src.getUse());
562                 if (src.getKeyInfo())
563                     setKeyInfo(src.getKeyInfo()->cloneKeyInfo());
564                 VectorOf(EncryptionMethod) v=getEncryptionMethods();
565                 for (vector<EncryptionMethod*>::const_iterator i=src.m_EncryptionMethods.begin(); i!=src.m_EncryptionMethods.end(); i++) {
566                     if (*i) {
567                         v.push_back((*i)->cloneEncryptionMethod());
568                     }
569                 }
570             }
571
572             IMPL_XMLOBJECT_CLONE(KeyDescriptor);
573             IMPL_STRING_ATTRIB(Use);
574             IMPL_TYPED_FOREIGN_CHILD(KeyInfo,xmlsignature);
575             IMPL_TYPED_FOREIGN_CHILDREN(EncryptionMethod,xmlencryption,m_children.end());
576
577         protected:
578             void marshallAttributes(DOMElement* domElement) const {
579                 MARSHALL_STRING_ATTRIB(Use,USE,nullptr);
580             }
581
582             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
583                 PROC_TYPED_FOREIGN_CHILD(KeyInfo,xmlsignature,XMLSIG_NS,false);
584                 PROC_TYPED_FOREIGN_CHILDREN(EncryptionMethod,xmlencryption,SAML20MD_NS,false);
585                 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
586             }
587
588             void processAttribute(const DOMAttr* attribute) {
589                 PROC_STRING_ATTRIB(Use,USE,nullptr);
590                 AbstractXMLObjectUnmarshaller::processAttribute(attribute);
591             }
592         };
593
594         class SAML_DLLLOCAL EndpointTypeImpl : public virtual EndpointType,
595             public AbstractAttributeExtensibleXMLObject,
596             public AbstractComplexElement,
597             public AbstractDOMCachingXMLObject,
598             public AbstractXMLObjectMarshaller,
599             public AbstractXMLObjectUnmarshaller
600         {
601             void init() {
602                 m_Binding=m_Location=m_ResponseLocation=nullptr;
603             }
604
605         protected:
606             EndpointTypeImpl() {
607                 init();
608             }
609
610         public:
611             virtual ~EndpointTypeImpl() {
612                 XMLString::release(&m_Binding);
613                 XMLString::release(&m_Location);
614                 XMLString::release(&m_ResponseLocation);
615             }
616
617             EndpointTypeImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
618                 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
619             }
620
621             EndpointTypeImpl(const EndpointTypeImpl& src)
622                     : AbstractXMLObject(src),
623                         AbstractAttributeExtensibleXMLObject(src),
624                         AbstractComplexElement(src),
625                         AbstractDOMCachingXMLObject(src) {
626                 setBinding(src.getBinding());
627                 setLocation(src.getLocation());
628                 setResponseLocation(src.getResponseLocation());
629                 VectorOf(XMLObject) v=getUnknownXMLObjects();
630                 for (vector<XMLObject*>::const_iterator i=src.m_UnknownXMLObjects.begin(); i!=src.m_UnknownXMLObjects.end(); ++i)
631                     v.push_back((*i)->clone());
632             }
633
634             IMPL_XMLOBJECT_CLONE(EndpointType);
635             IMPL_STRING_ATTRIB(Binding);
636             IMPL_STRING_ATTRIB(Location);
637             IMPL_STRING_ATTRIB(ResponseLocation);
638             IMPL_XMLOBJECT_CHILDREN(UnknownXMLObject,m_children.end());
639
640             void setAttribute(const xmltooling::QName& qualifiedName, const XMLCh* value, bool ID=false) {
641                 if (!qualifiedName.hasNamespaceURI()) {
642                     if (XMLString::equals(qualifiedName.getLocalPart(),BINDING_ATTRIB_NAME)) {
643                         setBinding(value);
644                         return;
645                     }
646                     else if (XMLString::equals(qualifiedName.getLocalPart(),LOCATION_ATTRIB_NAME)) {
647                         setLocation(value);
648                         return;
649                     }
650                     else if (XMLString::equals(qualifiedName.getLocalPart(),RESPONSELOCATION_ATTRIB_NAME)) {
651                         setResponseLocation(value);
652                         return;
653                     }
654                 }
655                 AbstractAttributeExtensibleXMLObject::setAttribute(qualifiedName, value, ID);
656             }
657         protected:
658             void marshallAttributes(DOMElement* domElement) const {
659                 MARSHALL_STRING_ATTRIB(Binding,BINDING,nullptr);
660                 MARSHALL_STRING_ATTRIB(Location,LOCATION,nullptr);
661                 MARSHALL_STRING_ATTRIB(ResponseLocation,RESPONSELOCATION,nullptr);
662                 marshallExtensionAttributes(domElement);
663             }
664
665             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
666                 // Unknown child.
667                 const XMLCh* nsURI=root->getNamespaceURI();
668                 if (!XMLString::equals(nsURI,SAML20MD_NS) && nsURI && *nsURI) {
669                     getUnknownXMLObjects().push_back(childXMLObject);
670                     return;
671                 }
672                 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
673             }
674
675             void processAttribute(const DOMAttr* attribute) {
676                 unmarshallExtensionAttribute(attribute);
677             }
678         };
679
680         class SAML_DLLLOCAL IndexedEndpointTypeImpl : public virtual IndexedEndpointType, public EndpointTypeImpl
681         {
682             void init() {
683                 m_Index=nullptr;
684                 m_isDefault=XML_BOOL_NULL;
685             }
686
687         protected:
688             IndexedEndpointTypeImpl() {
689                 init();
690             }
691         public:
692             virtual ~IndexedEndpointTypeImpl() {
693                 XMLString::release(&m_Index);
694             }
695
696             IndexedEndpointTypeImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
697                 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {}
698
699             IndexedEndpointTypeImpl(const IndexedEndpointTypeImpl& src) : AbstractXMLObject(src), EndpointTypeImpl(src) {
700                 setIndex(src.m_Index);
701                 isDefault(src.m_isDefault);
702             }
703
704             IMPL_XMLOBJECT_CLONE(IndexedEndpointType);
705             EndpointType* cloneEndpointType() const {
706                 return new IndexedEndpointTypeImpl(*this);
707             }
708
709             IMPL_INTEGER_ATTRIB(Index);
710             IMPL_BOOLEAN_ATTRIB(isDefault);
711
712             void setAttribute(const xmltooling::QName& qualifiedName, const XMLCh* value, bool ID=false) {
713                 if (!qualifiedName.hasNamespaceURI()) {
714                     if (XMLString::equals(qualifiedName.getLocalPart(),INDEX_ATTRIB_NAME)) {
715                         setIndex(value);
716                         return;
717                     }
718                     else if (XMLString::equals(qualifiedName.getLocalPart(),ISDEFAULT_ATTRIB_NAME)) {
719                         setisDefault(value);
720                         return;
721                     }
722                 }
723                 EndpointTypeImpl::setAttribute(qualifiedName, value, ID);
724             }
725
726         protected:
727             void marshallAttributes(DOMElement* domElement) const {
728                 MARSHALL_INTEGER_ATTRIB(Index,INDEX,nullptr);
729                 MARSHALL_BOOLEAN_ATTRIB(isDefault,ISDEFAULT,nullptr);
730                 EndpointTypeImpl::marshallAttributes(domElement);
731             }
732         };
733
734         class SAML_DLLLOCAL ArtifactResolutionServiceImpl : public virtual ArtifactResolutionService, public IndexedEndpointTypeImpl
735         {
736         public:
737             virtual ~ArtifactResolutionServiceImpl() {}
738
739             ArtifactResolutionServiceImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
740                 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {}
741
742             ArtifactResolutionServiceImpl(const ArtifactResolutionServiceImpl& src) : AbstractXMLObject(src), IndexedEndpointTypeImpl(src) {}
743
744             IMPL_XMLOBJECT_CLONE(ArtifactResolutionService);
745             IndexedEndpointType* cloneIndexedEndpointType() const {
746                 return new ArtifactResolutionServiceImpl(*this);
747             }
748             EndpointType* cloneEndpointType() const {
749                 return new ArtifactResolutionServiceImpl(*this);
750             }
751         };
752
753         class SAML_DLLLOCAL SingleLogoutServiceImpl : public virtual SingleLogoutService, public EndpointTypeImpl
754         {
755         public:
756             virtual ~SingleLogoutServiceImpl() {}
757
758             SingleLogoutServiceImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
759                 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {}
760
761             SingleLogoutServiceImpl(const SingleLogoutServiceImpl& src) : AbstractXMLObject(src), EndpointTypeImpl(src) {}
762
763             IMPL_XMLOBJECT_CLONE(SingleLogoutService);
764             EndpointType* cloneEndpointType() const {
765                 return new SingleLogoutServiceImpl(*this);
766             }
767         };
768
769         class SAML_DLLLOCAL ManageNameIDServiceImpl : public virtual ManageNameIDService, public EndpointTypeImpl
770         {
771         public:
772             virtual ~ManageNameIDServiceImpl() {}
773
774             ManageNameIDServiceImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
775                 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {}
776
777             ManageNameIDServiceImpl(const ManageNameIDServiceImpl& src) : AbstractXMLObject(src), EndpointTypeImpl(src) {}
778
779             IMPL_XMLOBJECT_CLONE(ManageNameIDService);
780             EndpointType* cloneEndpointType() const {
781                 return new ManageNameIDServiceImpl(*this);
782             }
783         };
784
785         class SAML_DLLLOCAL SingleSignOnServiceImpl : public virtual SingleSignOnService, public EndpointTypeImpl
786         {
787         public:
788             virtual ~SingleSignOnServiceImpl() {}
789
790             SingleSignOnServiceImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
791                 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {}
792
793             SingleSignOnServiceImpl(const SingleSignOnServiceImpl& src) : AbstractXMLObject(src), EndpointTypeImpl(src) {}
794
795             IMPL_XMLOBJECT_CLONE(SingleSignOnService);
796             EndpointType* cloneEndpointType() const {
797                 return new SingleSignOnServiceImpl(*this);
798             }
799         };
800
801         class SAML_DLLLOCAL NameIDMappingServiceImpl : public virtual NameIDMappingService, public EndpointTypeImpl
802         {
803         public:
804             virtual ~NameIDMappingServiceImpl() {}
805
806             NameIDMappingServiceImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
807                 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {}
808
809             NameIDMappingServiceImpl(const NameIDMappingServiceImpl& src) : AbstractXMLObject(src), EndpointTypeImpl(src) {}
810
811             IMPL_XMLOBJECT_CLONE(NameIDMappingService);
812             EndpointType* cloneEndpointType() const {
813                 return new NameIDMappingServiceImpl(*this);
814             }
815         };
816
817         class SAML_DLLLOCAL AssertionIDRequestServiceImpl : public virtual AssertionIDRequestService, public EndpointTypeImpl
818         {
819         public:
820             virtual ~AssertionIDRequestServiceImpl() {}
821
822             AssertionIDRequestServiceImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
823                 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {}
824
825             AssertionIDRequestServiceImpl(const AssertionIDRequestServiceImpl& src) : AbstractXMLObject(src), EndpointTypeImpl(src) {}
826
827             IMPL_XMLOBJECT_CLONE(AssertionIDRequestService);
828             EndpointType* cloneEndpointType() const {
829                 return new AssertionIDRequestServiceImpl(*this);
830             }
831         };
832
833         class SAML_DLLLOCAL AssertionConsumerServiceImpl : public virtual AssertionConsumerService, public IndexedEndpointTypeImpl
834         {
835         public:
836             virtual ~AssertionConsumerServiceImpl() {}
837
838             AssertionConsumerServiceImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
839                 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {}
840
841             AssertionConsumerServiceImpl(const AssertionConsumerServiceImpl& src) : AbstractXMLObject(src), IndexedEndpointTypeImpl(src) {}
842
843             IMPL_XMLOBJECT_CLONE(AssertionConsumerService);
844             EndpointType* cloneEndpointType() const {
845                 return new AssertionConsumerServiceImpl(*this);
846             }
847             IndexedEndpointType* cloneIndexedEndpointType() const {
848                 return new AssertionConsumerServiceImpl(*this);
849             }
850         };
851
852         class SAML_DLLLOCAL AuthnQueryServiceImpl : public virtual AuthnQueryService, public EndpointTypeImpl
853         {
854         public:
855             virtual ~AuthnQueryServiceImpl() {}
856
857             AuthnQueryServiceImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
858                 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {}
859
860             AuthnQueryServiceImpl(const AuthnQueryServiceImpl& src) : AbstractXMLObject(src), EndpointTypeImpl(src) {}
861
862             IMPL_XMLOBJECT_CLONE(AuthnQueryService);
863             EndpointType* cloneEndpointType() const {
864                 return new AuthnQueryServiceImpl(*this);
865             }
866         };
867
868         class SAML_DLLLOCAL AuthzServiceImpl : public virtual AuthzService, public EndpointTypeImpl
869         {
870         public:
871             virtual ~AuthzServiceImpl() {}
872
873             AuthzServiceImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
874                 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {}
875
876             AuthzServiceImpl(const AuthzServiceImpl& src) : AbstractXMLObject(src), EndpointTypeImpl(src) {}
877
878             IMPL_XMLOBJECT_CLONE(AuthzService);
879             EndpointType* cloneEndpointType() const {
880                 return new AuthzServiceImpl(*this);
881             }
882         };
883
884         class SAML_DLLLOCAL AttributeServiceImpl : public virtual AttributeService, public EndpointTypeImpl
885         {
886         public:
887             virtual ~AttributeServiceImpl() {}
888
889             AttributeServiceImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
890                 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {}
891
892             AttributeServiceImpl(const AttributeServiceImpl& src) : AbstractXMLObject(src), EndpointTypeImpl(src) {}
893
894             IMPL_XMLOBJECT_CLONE(AttributeService);
895             EndpointType* cloneEndpointType() const {
896                 return new AttributeServiceImpl(*this);
897             }
898         };
899
900         class SAML_DLLLOCAL RoleDescriptorImpl : public virtual RoleDescriptor,
901             public virtual SignableObject,
902             public AbstractComplexElement,
903             public AbstractAttributeExtensibleXMLObject,
904             public AbstractDOMCachingXMLObject,
905             public AbstractXMLObjectMarshaller,
906             public AbstractXMLObjectUnmarshaller
907         {
908             void init() {
909                 m_ID=m_ProtocolSupportEnumeration=m_ErrorURL=nullptr;
910                 m_ValidUntil=m_CacheDuration=nullptr;
911                 m_children.push_back(nullptr);
912                 m_children.push_back(nullptr);
913                 m_children.push_back(nullptr);
914                 m_children.push_back(nullptr);
915                 m_Signature=nullptr;
916                 m_Extensions=nullptr;
917                 m_Organization=nullptr;
918                 m_pos_Signature=m_children.begin();
919                 m_pos_Extensions=m_pos_Signature;
920                 ++m_pos_Extensions;
921                 m_pos_Organization=m_pos_Extensions;
922                 ++m_pos_Organization;
923                 m_pos_ContactPerson=m_pos_Organization;
924                 ++m_pos_ContactPerson;
925             }
926
927         protected:
928             list<XMLObject*>::iterator m_pos_ContactPerson;
929
930             RoleDescriptorImpl() {
931                 init();
932             }
933
934         public:
935             virtual ~RoleDescriptorImpl() {
936                 XMLString::release(&m_ID);
937                 XMLString::release(&m_ProtocolSupportEnumeration);
938                 XMLString::release(&m_ErrorURL);
939                 delete m_ValidUntil;
940                 delete m_CacheDuration;
941             }
942
943             RoleDescriptorImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
944                 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
945                 init();
946             }
947
948             RoleDescriptorImpl(const RoleDescriptorImpl& src)
949                     : AbstractXMLObject(src), AbstractComplexElement(src),
950                         AbstractAttributeExtensibleXMLObject(src), AbstractDOMCachingXMLObject(src) {
951                 init();
952                 setID(src.getID());
953                 setProtocolSupportEnumeration(src.getProtocolSupportEnumeration());
954                 setErrorURL(src.getErrorURL());
955                 setValidUntil(src.getValidUntil());
956                 setCacheDuration(src.getCacheDuration());
957                 if (src.getSignature())
958                     setSignature(src.getSignature()->cloneSignature());
959                 if (src.getExtensions())
960                     setExtensions(src.getExtensions()->cloneExtensions());
961                 if (src.getOrganization())
962                     setOrganization(src.getOrganization()->cloneOrganization());
963
964                 VectorOf(KeyDescriptor) v=getKeyDescriptors();
965                 for (vector<KeyDescriptor*>::const_iterator i=src.m_KeyDescriptors.begin(); i!=src.m_KeyDescriptors.end(); i++) {
966                     if (*i) {
967                         v.push_back((*i)->cloneKeyDescriptor());
968                     }
969                 }
970                 VectorOf(ContactPerson) w=getContactPersons();
971                 for (vector<ContactPerson*>::const_iterator j=src.m_ContactPersons.begin(); j!=src.m_ContactPersons.end(); j++) {
972                     if (*j) {
973                         w.push_back((*j)->cloneContactPerson());
974                     }
975                 }
976             }
977
978             //IMPL_TYPED_CHILD(Signature);
979             // Need customized setter.
980         protected:
981             Signature* m_Signature;
982             list<XMLObject*>::iterator m_pos_Signature;
983         public:
984             Signature* getSignature() const {
985                 return m_Signature;
986             }
987
988             void setSignature(Signature* sig) {
989                 prepareForAssignment(m_Signature,sig);
990                 *m_pos_Signature=m_Signature=sig;
991                 // Sync content reference back up.
992                 if (m_Signature)
993                     m_Signature->setContentReference(new opensaml::ContentReference(*this));
994             }
995
996             IMPL_ID_ATTRIB_EX(ID,ID,nullptr);
997             IMPL_STRING_ATTRIB(ProtocolSupportEnumeration);
998             IMPL_STRING_ATTRIB(ErrorURL);
999             IMPL_DATETIME_ATTRIB(ValidUntil,SAMLTIME_MAX);
1000             IMPL_DURATION_ATTRIB(CacheDuration,0);
1001             IMPL_TYPED_CHILD(Extensions);
1002             IMPL_TYPED_CHILDREN(KeyDescriptor,m_pos_Organization);
1003             IMPL_TYPED_CHILD(Organization);
1004             IMPL_TYPED_CHILDREN(ContactPerson,m_pos_ContactPerson);
1005
1006             bool hasSupport(const XMLCh* protocol) const {
1007                 if (!protocol || !*protocol)
1008                     return true;
1009                 if (m_ProtocolSupportEnumeration) {
1010                     // Look for first character.
1011                     xsecsize_t len=XMLString::stringLen(protocol);
1012                     xsecsize_t pos=0;
1013                     int index=XMLString::indexOf(m_ProtocolSupportEnumeration,protocol[0],pos);
1014                     while (index>=0) {
1015                         // Only possible match is if it's the first character or a space comes before it.
1016                         if (index==0 || m_ProtocolSupportEnumeration[index-1]==chSpace) {
1017                             // See if rest of protocol string is present.
1018                             if (0==XMLString::compareNString(m_ProtocolSupportEnumeration+index+1,protocol+1,len-1)) {
1019                                 // Only possible match is if it's the last character or a space comes after it.
1020                                 if (m_ProtocolSupportEnumeration[index+len]==chNull || m_ProtocolSupportEnumeration[index+len]==chSpace)
1021                                     return true;
1022                                 else
1023                                     pos=index+len;
1024                             }
1025                             else {
1026                                 // Move past last search and start again.
1027                                 pos=index+1;
1028                             }
1029                         }
1030                         else {
1031                             // Move past last search and start again.
1032                             pos=index+1;
1033                         }
1034                         index=XMLString::indexOf(m_ProtocolSupportEnumeration,protocol[0],pos);
1035                     }
1036                 }
1037                 return false;
1038             }
1039
1040             void addSupport(const XMLCh* protocol) {
1041                 if (hasSupport(protocol))
1042                     return;
1043                 if (m_ProtocolSupportEnumeration && *m_ProtocolSupportEnumeration) {
1044 #ifdef HAVE_GOOD_STL
1045                     xstring pse(m_ProtocolSupportEnumeration);
1046                     pse = pse + chSpace + protocol;
1047                     setProtocolSupportEnumeration(pse.c_str());
1048 #else
1049                     auto_ptr_char temp(m_ProtocolSupportEnumeration);
1050                     auto_ptr_char temp2(protocol);
1051                     string pse(temp.get());
1052                     pse = pse + ' ' + temp2.get();
1053                     auto_ptr_XMLCh temp3(pse.c_str());
1054                     setProtocolSupportEnumeration(temp3.get());
1055 #endif
1056                 }
1057                 else {
1058                     setProtocolSupportEnumeration(protocol);
1059                 }
1060             }
1061
1062             void setAttribute(const xmltooling::QName& qualifiedName, const XMLCh* value, bool ID=false) {
1063                 if (!qualifiedName.hasNamespaceURI()) {
1064                     if (XMLString::equals(qualifiedName.getLocalPart(),ID_ATTRIB_NAME)) {
1065                         setID(value);
1066                         return;
1067                     }
1068                     else if (XMLString::equals(qualifiedName.getLocalPart(),PROTOCOLSUPPORTENUMERATION_ATTRIB_NAME)) {
1069                         setProtocolSupportEnumeration(value);
1070                         return;
1071                     }
1072                     else if (XMLString::equals(qualifiedName.getLocalPart(),ERRORURL_ATTRIB_NAME)) {
1073                         setErrorURL(value);
1074                         return;
1075                     }
1076                     else if (XMLString::equals(qualifiedName.getLocalPart(),VALIDUNTIL_ATTRIB_NAME)) {
1077                         setValidUntil(value);
1078                         return;
1079                     }
1080                     else if (XMLString::equals(qualifiedName.getLocalPart(),CACHEDURATION_ATTRIB_NAME)) {
1081                         setCacheDuration(value);
1082                         return;
1083                     }
1084                 }
1085                 AbstractAttributeExtensibleXMLObject::setAttribute(qualifiedName, value, ID);
1086             }
1087
1088         protected:
1089             void prepareForMarshalling() const {
1090                 if (m_Signature)
1091                     declareNonVisibleNamespaces();
1092             }
1093
1094             void marshallAttributes(DOMElement* domElement) const {
1095                 MARSHALL_ID_ATTRIB(ID,ID,nullptr);
1096                 MARSHALL_STRING_ATTRIB(ProtocolSupportEnumeration,PROTOCOLSUPPORTENUMERATION,nullptr);
1097                 MARSHALL_STRING_ATTRIB(ErrorURL,ERRORURL,nullptr);
1098                 MARSHALL_DATETIME_ATTRIB(ValidUntil,VALIDUNTIL,nullptr);
1099                 MARSHALL_DATETIME_ATTRIB(CacheDuration,CACHEDURATION,nullptr);
1100                 marshallExtensionAttributes(domElement);
1101             }
1102
1103             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
1104                 PROC_TYPED_FOREIGN_CHILD(Signature,xmlsignature,XMLSIG_NS,false);
1105                 PROC_TYPED_CHILD(Extensions,SAML20MD_NS,false);
1106                 PROC_TYPED_CHILDREN(KeyDescriptor,SAML20MD_NS,false);
1107                 PROC_TYPED_CHILD(Organization,SAML20MD_NS,false);
1108                 PROC_TYPED_CHILDREN(ContactPerson,SAML20MD_NS,false);
1109                 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
1110             }
1111
1112             void processAttribute(const DOMAttr* attribute) {
1113                 PROC_ID_ATTRIB(ID,ID,nullptr);
1114                 unmarshallExtensionAttribute(attribute);
1115             }
1116         };
1117
1118         class SAML_DLLLOCAL RoleDescriptorTypeImpl : public virtual RoleDescriptorType, public RoleDescriptorImpl
1119         {
1120         public:
1121             virtual ~RoleDescriptorTypeImpl() {}
1122
1123             RoleDescriptorTypeImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
1124                 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
1125             }
1126
1127             RoleDescriptorTypeImpl(const RoleDescriptorTypeImpl& src) : AbstractXMLObject(src), RoleDescriptorImpl(src) {
1128                 VectorOf(XMLObject) v=getUnknownXMLObjects();
1129                 for (vector<XMLObject*>::const_iterator i=src.m_UnknownXMLObjects.begin(); i!=src.m_UnknownXMLObjects.end(); ++i)
1130                     v.push_back((*i)->clone());
1131             }
1132
1133             IMPL_XMLOBJECT_CLONE(RoleDescriptorType);
1134             RoleDescriptor* cloneRoleDescriptor() const {
1135                 return new RoleDescriptorTypeImpl(*this);
1136             }
1137
1138             IMPL_XMLOBJECT_CHILDREN(UnknownXMLObject,m_children.end());
1139
1140         protected:
1141             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
1142                 getUnknownXMLObjects().push_back(childXMLObject);
1143             }
1144         };
1145
1146         class SAML_DLLLOCAL SSODescriptorTypeImpl : public virtual SSODescriptorType, public RoleDescriptorImpl
1147         {
1148             void init() {
1149                 m_children.push_back(nullptr);
1150                 m_children.push_back(nullptr);
1151                 m_children.push_back(nullptr);
1152                 m_children.push_back(nullptr);
1153                 m_pos_ArtifactResolutionService=m_pos_ContactPerson;
1154                 ++m_pos_ArtifactResolutionService;
1155                 m_pos_SingleLogoutService=m_pos_ArtifactResolutionService;
1156                 ++m_pos_SingleLogoutService;
1157                 m_pos_ManageNameIDService=m_pos_SingleLogoutService;
1158                 ++m_pos_ManageNameIDService;
1159                 m_pos_NameIDFormat=m_pos_ManageNameIDService;
1160                 ++m_pos_NameIDFormat;
1161             }
1162
1163         protected:
1164             list<XMLObject*>::iterator m_pos_ArtifactResolutionService;
1165             list<XMLObject*>::iterator m_pos_SingleLogoutService;
1166             list<XMLObject*>::iterator m_pos_ManageNameIDService;
1167             list<XMLObject*>::iterator m_pos_NameIDFormat;
1168
1169             SSODescriptorTypeImpl() {
1170                 init();
1171             }
1172
1173         public:
1174             virtual ~SSODescriptorTypeImpl() {}
1175
1176             SSODescriptorTypeImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
1177                 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
1178                 init();
1179             }
1180
1181             SSODescriptorTypeImpl(const SSODescriptorTypeImpl& src) : AbstractXMLObject(src), RoleDescriptorImpl(src) {
1182                 init();
1183                 VectorOf(ArtifactResolutionService) v=getArtifactResolutionServices();
1184                 for (vector<ArtifactResolutionService*>::const_iterator i=src.m_ArtifactResolutionServices.begin(); i!=src.m_ArtifactResolutionServices.end(); i++) {
1185                     if (*i) {
1186                         v.push_back((*i)->cloneArtifactResolutionService());
1187                     }
1188                 }
1189                 VectorOf(SingleLogoutService) w=getSingleLogoutServices();
1190                 for (vector<SingleLogoutService*>::const_iterator j=src.m_SingleLogoutServices.begin(); j!=src.m_SingleLogoutServices.end(); j++) {
1191                     if (*j) {
1192                         w.push_back((*j)->cloneSingleLogoutService());
1193                     }
1194                 }
1195                 VectorOf(ManageNameIDService) x=getManageNameIDServices();
1196                 for (vector<ManageNameIDService*>::const_iterator k=src.m_ManageNameIDServices.begin(); k!=src.m_ManageNameIDServices.end(); k++) {
1197                     if (*k) {
1198                         x.push_back((*k)->cloneManageNameIDService());
1199                     }
1200                 }
1201                 VectorOf(NameIDFormat) y=getNameIDFormats();
1202                 for (vector<NameIDFormat*>::const_iterator m=src.m_NameIDFormats.begin(); m!=src.m_NameIDFormats.end(); m++) {
1203                     if (*m) {
1204                         y.push_back((*m)->cloneNameIDFormat());
1205                     }
1206                 }
1207             }
1208
1209             IMPL_TYPED_CHILDREN(ArtifactResolutionService,m_pos_ArtifactResolutionService);
1210             IMPL_TYPED_CHILDREN(SingleLogoutService,m_pos_SingleLogoutService);
1211             IMPL_TYPED_CHILDREN(ManageNameIDService,m_pos_ManageNameIDService);
1212             IMPL_TYPED_CHILDREN(NameIDFormat,m_pos_NameIDFormat);
1213
1214         protected:
1215             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
1216                 PROC_TYPED_CHILDREN(ArtifactResolutionService,SAML20MD_NS,false);
1217                 PROC_TYPED_CHILDREN(SingleLogoutService,SAML20MD_NS,false);
1218                 PROC_TYPED_CHILDREN(ManageNameIDService,SAML20MD_NS,false);
1219                 PROC_TYPED_CHILDREN(NameIDFormat,SAML20MD_NS,false);
1220                 RoleDescriptorImpl::processChildElement(childXMLObject,root);
1221             }
1222         };
1223
1224         class SAML_DLLLOCAL IDPSSODescriptorImpl : public virtual IDPSSODescriptor, public SSODescriptorTypeImpl
1225         {
1226             list<XMLObject*>::iterator m_pos_SingleSignOnService;
1227             list<XMLObject*>::iterator m_pos_NameIDMappingService;
1228             list<XMLObject*>::iterator m_pos_AssertionIDRequestService;
1229             list<XMLObject*>::iterator m_pos_AttributeProfile;
1230
1231             void init() {
1232                 m_WantAuthnRequestsSigned=XML_BOOL_NULL;
1233                 m_children.push_back(nullptr);
1234                 m_children.push_back(nullptr);
1235                 m_children.push_back(nullptr);
1236                 m_children.push_back(nullptr);
1237                 m_pos_SingleSignOnService=m_pos_NameIDFormat;
1238                 ++m_pos_SingleSignOnService;
1239                 m_pos_NameIDMappingService=m_pos_SingleSignOnService;
1240                 ++m_pos_NameIDMappingService;
1241                 m_pos_AssertionIDRequestService=m_pos_NameIDMappingService;
1242                 ++m_pos_AssertionIDRequestService;
1243                 m_pos_AttributeProfile=m_pos_AssertionIDRequestService;
1244                 ++m_pos_AttributeProfile;
1245             }
1246
1247         public:
1248             virtual ~IDPSSODescriptorImpl() {}
1249
1250             IDPSSODescriptorImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
1251                 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
1252                 init();
1253             }
1254
1255             IDPSSODescriptorImpl(const IDPSSODescriptorImpl& src) : AbstractXMLObject(src), SSODescriptorTypeImpl(src) {
1256                 init();
1257                 WantAuthnRequestsSigned(src.m_WantAuthnRequestsSigned);
1258                 VectorOf(SingleSignOnService) v=getSingleSignOnServices();
1259                 for (vector<SingleSignOnService*>::const_iterator i=src.m_SingleSignOnServices.begin(); i!=src.m_SingleSignOnServices.end(); i++) {
1260                     if (*i) {
1261                         v.push_back((*i)->cloneSingleSignOnService());
1262                     }
1263                 }
1264                 VectorOf(NameIDMappingService) w=getNameIDMappingServices();
1265                 for (vector<NameIDMappingService*>::const_iterator j=src.m_NameIDMappingServices.begin(); j!=src.m_NameIDMappingServices.end(); j++) {
1266                     if (*j) {
1267                         w.push_back((*j)->cloneNameIDMappingService());
1268                     }
1269                 }
1270                 VectorOf(AssertionIDRequestService) x=getAssertionIDRequestServices();
1271                 for (vector<AssertionIDRequestService*>::const_iterator k=src.m_AssertionIDRequestServices.begin(); k!=src.m_AssertionIDRequestServices.end(); k++) {
1272                     if (*k) {
1273                         x.push_back((*k)->cloneAssertionIDRequestService());
1274                     }
1275                 }
1276                 VectorOf(AttributeProfile) y=getAttributeProfiles();
1277                 for (vector<AttributeProfile*>::const_iterator m=src.m_AttributeProfiles.begin(); m!=src.m_AttributeProfiles.end(); m++) {
1278                     if (*m) {
1279                         y.push_back((*m)->cloneAttributeProfile());
1280                     }
1281                 }
1282                 VectorOf(Attribute) z=getAttributes();
1283                 for (vector<Attribute*>::const_iterator n=src.m_Attributes.begin(); n!=src.m_Attributes.end(); n++) {
1284                     if (*n) {
1285                         z.push_back((*n)->cloneAttribute());
1286                     }
1287                 }
1288             }
1289
1290             IMPL_XMLOBJECT_CLONE(IDPSSODescriptor);
1291             SSODescriptorType* cloneSSODescriptorType() const {
1292                 return new IDPSSODescriptorImpl(*this);
1293             }
1294             RoleDescriptor* cloneRoleDescriptor() const {
1295                 return new IDPSSODescriptorImpl(*this);
1296             }
1297
1298             IMPL_BOOLEAN_ATTRIB(WantAuthnRequestsSigned);
1299             IMPL_TYPED_CHILDREN(SingleSignOnService,m_pos_SingleSignOnService);
1300             IMPL_TYPED_CHILDREN(NameIDMappingService,m_pos_NameIDMappingService);
1301             IMPL_TYPED_CHILDREN(AssertionIDRequestService,m_pos_AssertionIDRequestService);
1302             IMPL_TYPED_CHILDREN(AttributeProfile,m_pos_AttributeProfile);
1303             IMPL_TYPED_FOREIGN_CHILDREN(Attribute,saml2,m_children.end());
1304
1305             void setAttribute(const xmltooling::QName& qualifiedName, const XMLCh* value, bool ID=false) {
1306                 if (!qualifiedName.hasNamespaceURI()) {
1307                     if (XMLString::equals(qualifiedName.getLocalPart(),WANTAUTHNREQUESTSSIGNED_ATTRIB_NAME)) {
1308                         setWantAuthnRequestsSigned(value);
1309                         return;
1310                     }
1311                 }
1312                 RoleDescriptorImpl::setAttribute(qualifiedName, value, ID);
1313             }
1314
1315         protected:
1316             void marshallAttributes(DOMElement* domElement) const {
1317                 MARSHALL_BOOLEAN_ATTRIB(WantAuthnRequestsSigned,WANTAUTHNREQUESTSSIGNED,nullptr);
1318                 RoleDescriptorImpl::marshallAttributes(domElement);
1319             }
1320
1321             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
1322                 PROC_TYPED_CHILDREN(SingleSignOnService,SAML20MD_NS,false);
1323                 PROC_TYPED_CHILDREN(NameIDMappingService,SAML20MD_NS,false);
1324                 PROC_TYPED_CHILDREN(AssertionIDRequestService,SAML20MD_NS,false);
1325                 PROC_TYPED_CHILDREN(AttributeProfile,SAML20MD_NS,false);
1326                 PROC_TYPED_FOREIGN_CHILDREN(Attribute,saml2,SAML20_NS,false);
1327                 SSODescriptorTypeImpl::processChildElement(childXMLObject,root);
1328             }
1329         };
1330
1331         class SAML_DLLLOCAL RequestedAttributeImpl : public virtual RequestedAttribute,
1332             public AbstractComplexElement,
1333             public AbstractAttributeExtensibleXMLObject,
1334             public AbstractDOMCachingXMLObject,
1335             public AbstractXMLObjectMarshaller,
1336             public AbstractXMLObjectUnmarshaller
1337         {
1338             void init() {
1339                 m_Name=m_NameFormat=m_FriendlyName=nullptr;
1340                 m_isRequired=XML_BOOL_NULL;
1341             }
1342         public:
1343             virtual ~RequestedAttributeImpl() {
1344                 XMLString::release(&m_Name);
1345                 XMLString::release(&m_NameFormat);
1346                 XMLString::release(&m_FriendlyName);
1347             }
1348
1349             RequestedAttributeImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
1350                 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
1351                 init();
1352             }
1353
1354             RequestedAttributeImpl(const RequestedAttributeImpl& src)
1355                     : AbstractXMLObject(src), AbstractComplexElement(src),
1356                         AbstractAttributeExtensibleXMLObject(src), AbstractDOMCachingXMLObject(src) {
1357                 init();
1358                 setName(src.getName());
1359                 setNameFormat(src.getNameFormat());
1360                 setFriendlyName(src.getFriendlyName());
1361                 isRequired(src.m_isRequired);
1362                 VectorOf(XMLObject) v=getAttributeValues();
1363                 for (vector<XMLObject*>::const_iterator i=src.m_AttributeValues.begin(); i!=src.m_AttributeValues.end(); i++) {
1364                     if (*i) {
1365                         v.push_back((*i)->clone());
1366                     }
1367                 }
1368             }
1369
1370             IMPL_XMLOBJECT_CLONE(RequestedAttribute);
1371             Attribute* cloneAttribute() const {
1372                 return new RequestedAttributeImpl(*this);
1373             }
1374
1375             IMPL_STRING_ATTRIB(Name);
1376             IMPL_STRING_ATTRIB(NameFormat);
1377             IMPL_STRING_ATTRIB(FriendlyName);
1378             IMPL_BOOLEAN_ATTRIB(isRequired);
1379             IMPL_XMLOBJECT_CHILDREN(AttributeValue,m_children.end());
1380
1381             void setAttribute(const xmltooling::QName& qualifiedName, const XMLCh* value, bool ID=false) {
1382                 if (!qualifiedName.hasNamespaceURI()) {
1383                     if (XMLString::equals(qualifiedName.getLocalPart(),NAME_ATTRIB_NAME)) {
1384                         setName(value);
1385                         return;
1386                     }
1387                     else if (XMLString::equals(qualifiedName.getLocalPart(),NAMEFORMAT_ATTRIB_NAME)) {
1388                         setNameFormat(value);
1389                         return;
1390                     }
1391                     else if (XMLString::equals(qualifiedName.getLocalPart(),FRIENDLYNAME_ATTRIB_NAME)) {
1392                         setFriendlyName(value);
1393                         return;
1394                     }
1395                     else if (XMLString::equals(qualifiedName.getLocalPart(),ISREQUIRED_ATTRIB_NAME)) {
1396                         setisRequired(value);
1397                         return;
1398                     }
1399                 }
1400                 AbstractAttributeExtensibleXMLObject::setAttribute(qualifiedName, value, ID);
1401             }
1402
1403         protected:
1404             void marshallAttributes(DOMElement* domElement) const {
1405                 MARSHALL_STRING_ATTRIB(Name,NAME,nullptr);
1406                 MARSHALL_STRING_ATTRIB(NameFormat,NAMEFORMAT,nullptr);
1407                 MARSHALL_STRING_ATTRIB(FriendlyName,FRIENDLYNAME,nullptr);
1408                 MARSHALL_BOOLEAN_ATTRIB(isRequired,ISREQUIRED,nullptr);
1409                 marshallExtensionAttributes(domElement);
1410             }
1411
1412             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
1413                 getAttributeValues().push_back(childXMLObject);
1414             }
1415
1416             void processAttribute(const DOMAttr* attribute) {
1417                 unmarshallExtensionAttribute(attribute);
1418             }
1419         };
1420
1421         class SAML_DLLLOCAL AttributeConsumingServiceImpl : public virtual AttributeConsumingService,
1422             public AbstractComplexElement,
1423             public AbstractDOMCachingXMLObject,
1424             public AbstractXMLObjectMarshaller,
1425             public AbstractXMLObjectUnmarshaller
1426         {
1427             list<XMLObject*>::iterator m_pos_ServiceDescription;
1428             list<XMLObject*>::iterator m_pos_RequestedAttribute;
1429
1430                 void init() {
1431                 m_Index=nullptr;
1432                 m_isDefault=XML_BOOL_NULL;
1433                 m_children.push_back(nullptr);
1434                 m_children.push_back(nullptr);
1435                 m_pos_ServiceDescription=m_children.begin();
1436                 m_pos_RequestedAttribute=m_pos_ServiceDescription;
1437                 ++m_pos_RequestedAttribute;
1438             }
1439
1440         public:
1441             virtual ~AttributeConsumingServiceImpl() {
1442                 XMLString::release(&m_Index);
1443             }
1444
1445             AttributeConsumingServiceImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
1446                 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
1447                 init();
1448             }
1449
1450             AttributeConsumingServiceImpl(const AttributeConsumingServiceImpl& src)
1451                     : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
1452                 init();
1453                 setIndex(src.m_Index);
1454                 isDefault(src.m_isDefault);
1455                 VectorOf(ServiceName) v=getServiceNames();
1456                 for (vector<ServiceName*>::const_iterator i=src.m_ServiceNames.begin(); i!=src.m_ServiceNames.end(); i++) {
1457                     if (*i) {
1458                         v.push_back((*i)->cloneServiceName());
1459                     }
1460                 }
1461                 VectorOf(ServiceDescription) w=getServiceDescriptions();
1462                 for (vector<ServiceDescription*>::const_iterator j=src.m_ServiceDescriptions.begin(); j!=src.m_ServiceDescriptions.end(); j++) {
1463                     if (*j) {
1464                         w.push_back((*j)->cloneServiceDescription());
1465                     }
1466                 }
1467                 VectorOf(RequestedAttribute) x=getRequestedAttributes();
1468                 for (vector<RequestedAttribute*>::const_iterator k=src.m_RequestedAttributes.begin(); k!=src.m_RequestedAttributes.end(); k++) {
1469                     if (*k) {
1470                         x.push_back((*k)->cloneRequestedAttribute());
1471                     }
1472                 }
1473             }
1474
1475             IMPL_XMLOBJECT_CLONE(AttributeConsumingService);
1476             IMPL_INTEGER_ATTRIB(Index);
1477             IMPL_BOOLEAN_ATTRIB(isDefault);
1478             IMPL_TYPED_CHILDREN(ServiceName,m_pos_ServiceDescription);
1479             IMPL_TYPED_CHILDREN(ServiceDescription,m_pos_RequestedAttribute);
1480             IMPL_TYPED_CHILDREN(RequestedAttribute,m_children.end());
1481
1482         protected:
1483             void marshallAttributes(DOMElement* domElement) const {
1484                 MARSHALL_INTEGER_ATTRIB(Index,INDEX,nullptr);
1485                 MARSHALL_BOOLEAN_ATTRIB(isDefault,ISDEFAULT,nullptr);
1486             }
1487
1488             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
1489                 PROC_TYPED_CHILDREN(ServiceName,SAML20MD_NS,false);
1490                 PROC_TYPED_CHILDREN(ServiceDescription,SAML20MD_NS,false);
1491                 PROC_TYPED_CHILDREN(RequestedAttribute,SAML20MD_NS,false);
1492                 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
1493             }
1494
1495             void processAttribute(const DOMAttr* attribute) {
1496                 PROC_INTEGER_ATTRIB(Index,INDEX,nullptr);
1497                 PROC_BOOLEAN_ATTRIB(isDefault,ISDEFAULT,nullptr);
1498                 AbstractXMLObjectUnmarshaller::processAttribute(attribute);
1499             }
1500         };
1501
1502         class SAML_DLLLOCAL SPSSODescriptorImpl : public virtual SPSSODescriptor, public SSODescriptorTypeImpl
1503         {
1504             list<XMLObject*>::iterator m_pos_AssertionConsumerService;
1505
1506             void init() {
1507                 m_AuthnRequestsSigned=XML_BOOL_NULL;
1508                 m_WantAssertionsSigned=XML_BOOL_NULL;
1509                 m_children.push_back(nullptr);
1510                 m_pos_AssertionConsumerService=m_pos_NameIDFormat;
1511                 ++m_pos_AssertionConsumerService;
1512             }
1513
1514         public:
1515             virtual ~SPSSODescriptorImpl() {}
1516
1517             SPSSODescriptorImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
1518                 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
1519                 init();
1520             }
1521
1522             SPSSODescriptorImpl(const SPSSODescriptorImpl& src) : AbstractXMLObject(src), SSODescriptorTypeImpl(src) {
1523                 init();
1524                 AuthnRequestsSigned(src.m_AuthnRequestsSigned);
1525                 WantAssertionsSigned(src.m_WantAssertionsSigned);
1526                 VectorOf(AssertionConsumerService) v=getAssertionConsumerServices();
1527                 for (vector<AssertionConsumerService*>::const_iterator i=src.m_AssertionConsumerServices.begin(); i!=src.m_AssertionConsumerServices.end(); i++) {
1528                     if (*i) {
1529                         v.push_back((*i)->cloneAssertionConsumerService());
1530                     }
1531                 }
1532                 VectorOf(AttributeConsumingService) w=getAttributeConsumingServices();
1533                 for (vector<AttributeConsumingService*>::const_iterator j=src.m_AttributeConsumingServices.begin(); j!=src.m_AttributeConsumingServices.end(); j++) {
1534                     if (*j) {
1535                         w.push_back((*j)->cloneAttributeConsumingService());
1536                     }
1537                 }
1538             }
1539
1540             IMPL_XMLOBJECT_CLONE(SPSSODescriptor);
1541             SSODescriptorType* cloneSSODescriptorType() const {
1542                 return cloneSPSSODescriptor();
1543             }
1544             RoleDescriptor* cloneRoleDescriptor() const {
1545                 return cloneSPSSODescriptor();
1546             }
1547
1548             IMPL_BOOLEAN_ATTRIB(AuthnRequestsSigned);
1549             IMPL_BOOLEAN_ATTRIB(WantAssertionsSigned);
1550             IMPL_TYPED_CHILDREN(AssertionConsumerService,m_pos_AssertionConsumerService);
1551             IMPL_TYPED_CHILDREN(AttributeConsumingService,m_children.end());
1552
1553             void setAttribute(const xmltooling::QName& qualifiedName, const XMLCh* value, bool ID=false) {
1554                 if (!qualifiedName.hasNamespaceURI()) {
1555                     if (XMLString::equals(qualifiedName.getLocalPart(),AUTHNREQUESTSSIGNED_ATTRIB_NAME)) {
1556                         setAuthnRequestsSigned(value);
1557                         return;
1558                     }
1559                     else if (XMLString::equals(qualifiedName.getLocalPart(),WANTASSERTIONSSIGNED_ATTRIB_NAME)) {
1560                         setWantAssertionsSigned(value);
1561                         return;
1562                     }
1563                 }
1564                 RoleDescriptorImpl::setAttribute(qualifiedName, value, ID);
1565             }
1566
1567         protected:
1568             void marshallAttributes(DOMElement* domElement) const {
1569                 MARSHALL_BOOLEAN_ATTRIB(AuthnRequestsSigned,AUTHNREQUESTSSIGNED,nullptr);
1570                 MARSHALL_BOOLEAN_ATTRIB(WantAssertionsSigned,WANTASSERTIONSSIGNED,nullptr);
1571                 RoleDescriptorImpl::marshallAttributes(domElement);
1572             }
1573
1574             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
1575                 PROC_TYPED_CHILDREN(AssertionConsumerService,SAML20MD_NS,false);
1576                 PROC_TYPED_CHILDREN(AttributeConsumingService,SAML20MD_NS,false);
1577                 SSODescriptorTypeImpl::processChildElement(childXMLObject,root);
1578             }
1579         };
1580
1581         class SAML_DLLLOCAL AuthnAuthorityDescriptorImpl : public virtual AuthnAuthorityDescriptor, public RoleDescriptorImpl
1582         {
1583             list<XMLObject*>::iterator m_pos_AuthnQueryService;
1584             list<XMLObject*>::iterator m_pos_AssertionIDRequestService;
1585
1586             void init() {
1587                 m_children.push_back(nullptr);
1588                 m_children.push_back(nullptr);
1589                 m_pos_AuthnQueryService=m_pos_ContactPerson;
1590                 ++m_pos_AuthnQueryService;
1591                 m_pos_AssertionIDRequestService=m_pos_AuthnQueryService;
1592                 ++m_pos_AssertionIDRequestService;
1593             }
1594
1595         public:
1596             virtual ~AuthnAuthorityDescriptorImpl() {}
1597
1598             AuthnAuthorityDescriptorImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
1599                 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
1600                 init();
1601             }
1602
1603             AuthnAuthorityDescriptorImpl(const AuthnAuthorityDescriptorImpl& src) : AbstractXMLObject(src), RoleDescriptorImpl(src) {
1604                 init();
1605                 VectorOf(AuthnQueryService) v=getAuthnQueryServices();
1606                 for (vector<AuthnQueryService*>::const_iterator i=src.m_AuthnQueryServices.begin(); i!=src.m_AuthnQueryServices.end(); i++) {
1607                     if (*i) {
1608                         v.push_back((*i)->cloneAuthnQueryService());
1609                     }
1610                 }
1611                 VectorOf(AssertionIDRequestService) w=getAssertionIDRequestServices();
1612                 for (vector<AssertionIDRequestService*>::const_iterator j=src.m_AssertionIDRequestServices.begin(); j!=src.m_AssertionIDRequestServices.end(); j++) {
1613                     if (*j) {
1614                         w.push_back((*j)->cloneAssertionIDRequestService());
1615                     }
1616                 }
1617                 VectorOf(NameIDFormat) x=getNameIDFormats();
1618                 for (vector<NameIDFormat*>::const_iterator k=src.m_NameIDFormats.begin(); k!=src.m_NameIDFormats.end(); k++) {
1619                     if (*k) {
1620                         x.push_back((*k)->cloneNameIDFormat());
1621                     }
1622                 }
1623             }
1624
1625             IMPL_XMLOBJECT_CLONE(AuthnAuthorityDescriptor);
1626             RoleDescriptor* cloneRoleDescriptor() const {
1627                 return cloneAuthnAuthorityDescriptor();
1628             }
1629
1630             IMPL_TYPED_CHILDREN(AuthnQueryService,m_pos_AuthnQueryService);
1631             IMPL_TYPED_CHILDREN(AssertionIDRequestService,m_pos_AssertionIDRequestService);
1632             IMPL_TYPED_CHILDREN(NameIDFormat,m_children.end());
1633
1634         protected:
1635             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
1636                 PROC_TYPED_CHILDREN(AuthnQueryService,SAML20MD_NS,false);
1637                 PROC_TYPED_CHILDREN(AssertionIDRequestService,SAML20MD_NS,false);
1638                 PROC_TYPED_CHILDREN(NameIDFormat,SAML20MD_NS,false);
1639                 RoleDescriptorImpl::processChildElement(childXMLObject,root);
1640             }
1641         };
1642
1643         class SAML_DLLLOCAL PDPDescriptorImpl : public virtual PDPDescriptor, public RoleDescriptorImpl
1644         {
1645             list<XMLObject*>::iterator m_pos_AuthzService;
1646             list<XMLObject*>::iterator m_pos_AssertionIDRequestService;
1647
1648             void init() {
1649                 m_children.push_back(nullptr);
1650                 m_children.push_back(nullptr);
1651                 m_pos_AuthzService=m_pos_ContactPerson;
1652                 ++m_pos_AuthzService;
1653                 m_pos_AssertionIDRequestService=m_pos_AuthzService;
1654                 ++m_pos_AssertionIDRequestService;
1655             }
1656
1657         public:
1658             virtual ~PDPDescriptorImpl() {}
1659
1660             PDPDescriptorImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
1661                 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
1662                 init();
1663             }
1664
1665             PDPDescriptorImpl(const PDPDescriptorImpl& src) : AbstractXMLObject(src), RoleDescriptorImpl(src) {
1666                 init();
1667                 VectorOf(AuthzService) v=getAuthzServices();
1668                 for (vector<AuthzService*>::const_iterator i=src.m_AuthzServices.begin(); i!=src.m_AuthzServices.end(); i++) {
1669                     if (*i) {
1670                         v.push_back((*i)->cloneAuthzService());
1671                     }
1672                 }
1673                 VectorOf(AssertionIDRequestService) w=getAssertionIDRequestServices();
1674                 for (vector<AssertionIDRequestService*>::const_iterator j=src.m_AssertionIDRequestServices.begin(); j!=src.m_AssertionIDRequestServices.end(); j++) {
1675                     if (*j) {
1676                         w.push_back((*j)->cloneAssertionIDRequestService());
1677                     }
1678                 }
1679                 VectorOf(NameIDFormat) x=getNameIDFormats();
1680                 for (vector<NameIDFormat*>::const_iterator k=src.m_NameIDFormats.begin(); k!=src.m_NameIDFormats.end(); k++) {
1681                     if (*k) {
1682                         x.push_back((*k)->cloneNameIDFormat());
1683                     }
1684                 }
1685             }
1686
1687             IMPL_XMLOBJECT_CLONE(PDPDescriptor);
1688             RoleDescriptor* cloneRoleDescriptor() const {
1689                 return clonePDPDescriptor();
1690             }
1691
1692             IMPL_TYPED_CHILDREN(AuthzService,m_pos_AuthzService);
1693             IMPL_TYPED_CHILDREN(AssertionIDRequestService,m_pos_AssertionIDRequestService);
1694             IMPL_TYPED_CHILDREN(NameIDFormat,m_children.end());
1695
1696         protected:
1697             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
1698                 PROC_TYPED_CHILDREN(AuthzService,SAML20MD_NS,false);
1699                 PROC_TYPED_CHILDREN(AssertionIDRequestService,SAML20MD_NS,false);
1700                 PROC_TYPED_CHILDREN(NameIDFormat,SAML20MD_NS,false);
1701                 RoleDescriptorImpl::processChildElement(childXMLObject,root);
1702             }
1703         };
1704
1705         class SAML_DLLLOCAL AttributeAuthorityDescriptorImpl : public virtual AttributeAuthorityDescriptor, public RoleDescriptorImpl
1706         {
1707             list<XMLObject*>::iterator m_pos_AttributeService;
1708             list<XMLObject*>::iterator m_pos_AssertionIDRequestService;
1709             list<XMLObject*>::iterator m_pos_NameIDFormat;
1710             list<XMLObject*>::iterator m_pos_AttributeProfile;
1711
1712             void init() {
1713                 m_children.push_back(nullptr);
1714                 m_children.push_back(nullptr);
1715                 m_children.push_back(nullptr);
1716                 m_children.push_back(nullptr);
1717                 m_pos_AttributeService=m_pos_ContactPerson;
1718                 ++m_pos_AttributeService;
1719                 m_pos_AssertionIDRequestService=m_pos_AttributeService;
1720                 ++m_pos_AssertionIDRequestService;
1721                 m_pos_NameIDFormat=m_pos_AssertionIDRequestService;
1722                 ++m_pos_NameIDFormat;
1723                 m_pos_AttributeProfile=m_pos_NameIDFormat;
1724                 ++m_pos_AttributeProfile;
1725             }
1726
1727         public:
1728             virtual ~AttributeAuthorityDescriptorImpl() {}
1729
1730             AttributeAuthorityDescriptorImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
1731                 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
1732                 init();
1733             }
1734
1735             AttributeAuthorityDescriptorImpl(const AttributeAuthorityDescriptorImpl& src) : AbstractXMLObject(src), RoleDescriptorImpl(src) {
1736                 init();
1737                 VectorOf(AttributeService) v=getAttributeServices();
1738                 for (vector<AttributeService*>::const_iterator i=src.m_AttributeServices.begin(); i!=src.m_AttributeServices.end(); i++) {
1739                     if (*i) {
1740                         v.push_back((*i)->cloneAttributeService());
1741                     }
1742                 }
1743                 VectorOf(AssertionIDRequestService) w=getAssertionIDRequestServices();
1744                 for (vector<AssertionIDRequestService*>::const_iterator j=src.m_AssertionIDRequestServices.begin(); j!=src.m_AssertionIDRequestServices.end(); j++) {
1745                     if (*j) {
1746                         w.push_back((*j)->cloneAssertionIDRequestService());
1747                     }
1748                 }
1749                 VectorOf(NameIDFormat) x=getNameIDFormats();
1750                 for (vector<NameIDFormat*>::const_iterator k=src.m_NameIDFormats.begin(); k!=src.m_NameIDFormats.end(); k++) {
1751                     if (*k) {
1752                         x.push_back((*k)->cloneNameIDFormat());
1753                     }
1754                 }
1755                 VectorOf(AttributeProfile) y=getAttributeProfiles();
1756                 for (vector<AttributeProfile*>::const_iterator m=src.m_AttributeProfiles.begin(); m!=src.m_AttributeProfiles.end(); m++) {
1757                     if (*m) {
1758                         y.push_back((*m)->cloneAttributeProfile());
1759                     }
1760                 }
1761                 VectorOf(Attribute) z=getAttributes();
1762                 for (vector<Attribute*>::const_iterator n=src.m_Attributes.begin(); n!=src.m_Attributes.end(); n++) {
1763                     if (*n) {
1764                         z.push_back((*n)->cloneAttribute());
1765                     }
1766                 }
1767             }
1768
1769             IMPL_XMLOBJECT_CLONE(AttributeAuthorityDescriptor);
1770             RoleDescriptor* cloneRoleDescriptor() const {
1771                 return cloneAttributeAuthorityDescriptor();
1772             }
1773
1774             IMPL_TYPED_CHILDREN(AttributeService,m_pos_AttributeService);
1775             IMPL_TYPED_CHILDREN(AssertionIDRequestService,m_pos_AssertionIDRequestService);
1776             IMPL_TYPED_CHILDREN(NameIDFormat,m_pos_NameIDFormat);
1777             IMPL_TYPED_CHILDREN(AttributeProfile,m_pos_AttributeProfile);
1778             IMPL_TYPED_FOREIGN_CHILDREN(Attribute,saml2,m_children.end());
1779
1780         protected:
1781             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
1782                 PROC_TYPED_CHILDREN(AttributeService,SAML20MD_NS,false);
1783                 PROC_TYPED_CHILDREN(AssertionIDRequestService,SAML20MD_NS,false);
1784                 PROC_TYPED_CHILDREN(NameIDFormat,SAML20MD_NS,false);
1785                 PROC_TYPED_CHILDREN(AttributeProfile,SAML20MD_NS,false);
1786                 PROC_TYPED_FOREIGN_CHILDREN(Attribute,saml2,SAML20_NS,false);
1787                 RoleDescriptorImpl::processChildElement(childXMLObject,root);
1788             }
1789         };
1790
1791         class SAML_DLLLOCAL QueryDescriptorTypeImpl : public virtual QueryDescriptorType, public RoleDescriptorImpl
1792         {
1793             void init() {
1794                 m_WantAssertionsSigned=XML_BOOL_NULL;
1795                 m_children.push_back(nullptr);
1796                 m_pos_NameIDFormat=m_pos_ContactPerson;
1797                 ++m_pos_NameIDFormat;
1798             }
1799
1800         protected:
1801             list<XMLObject*>::iterator m_pos_NameIDFormat;
1802
1803             QueryDescriptorTypeImpl() {
1804                 init();
1805             }
1806
1807         public:
1808             virtual ~QueryDescriptorTypeImpl() {}
1809
1810             QueryDescriptorTypeImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
1811                 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
1812                 init();
1813             }
1814
1815             QueryDescriptorTypeImpl(const QueryDescriptorTypeImpl& src) : AbstractXMLObject(src), RoleDescriptorImpl(src) {
1816                 init();
1817                 WantAssertionsSigned(src.m_WantAssertionsSigned);
1818                 VectorOf(NameIDFormat) y=getNameIDFormats();
1819                 for (vector<NameIDFormat*>::const_iterator m=src.m_NameIDFormats.begin(); m!=src.m_NameIDFormats.end(); m++) {
1820                     if (*m) {
1821                         y.push_back((*m)->cloneNameIDFormat());
1822                     }
1823                 }
1824             }
1825
1826             IMPL_BOOLEAN_ATTRIB(WantAssertionsSigned);
1827             IMPL_TYPED_CHILDREN(NameIDFormat,m_pos_NameIDFormat);
1828
1829             void setAttribute(const xmltooling::QName& qualifiedName, const XMLCh* value, bool ID=false) {
1830                 if (!qualifiedName.hasNamespaceURI()) {
1831                     if (XMLString::equals(qualifiedName.getLocalPart(),WANTASSERTIONSSIGNED_ATTRIB_NAME)) {
1832                         setWantAssertionsSigned(value);
1833                         return;
1834                     }
1835                 }
1836                 RoleDescriptorImpl::setAttribute(qualifiedName, value, ID);
1837             }
1838
1839         protected:
1840             void marshallAttributes(DOMElement* domElement) const {
1841                 MARSHALL_BOOLEAN_ATTRIB(WantAssertionsSigned,WANTASSERTIONSSIGNED,nullptr);
1842                 RoleDescriptorImpl::marshallAttributes(domElement);
1843             }
1844
1845             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
1846                 PROC_TYPED_CHILDREN(NameIDFormat,SAML20MD_NS,false);
1847                 RoleDescriptorImpl::processChildElement(childXMLObject,root);
1848             }
1849         };
1850
1851         class SAML_DLLLOCAL AuthnQueryDescriptorTypeImpl : public virtual AuthnQueryDescriptorType, public QueryDescriptorTypeImpl
1852         {
1853         public:
1854             virtual ~AuthnQueryDescriptorTypeImpl() {}
1855
1856             AuthnQueryDescriptorTypeImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
1857                 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {}
1858
1859             AuthnQueryDescriptorTypeImpl(const AuthnQueryDescriptorTypeImpl& src) : AbstractXMLObject(src), QueryDescriptorTypeImpl(src) {}
1860
1861             IMPL_XMLOBJECT_CLONE(AuthnQueryDescriptorType);
1862             QueryDescriptorType* cloneQueryDescriptorType() const {
1863                 return new AuthnQueryDescriptorTypeImpl(*this);
1864             }
1865             RoleDescriptor* cloneRoleDescriptor() const {
1866                 return new AuthnQueryDescriptorTypeImpl(*this);
1867             }
1868         };
1869
1870         class SAML_DLLLOCAL AttributeQueryDescriptorTypeImpl : public virtual AttributeQueryDescriptorType, public QueryDescriptorTypeImpl
1871         {
1872         public:
1873             virtual ~AttributeQueryDescriptorTypeImpl() {}
1874
1875             AttributeQueryDescriptorTypeImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
1876                 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {}
1877
1878             AttributeQueryDescriptorTypeImpl(const AttributeQueryDescriptorTypeImpl& src)
1879                     : AbstractXMLObject(src), QueryDescriptorTypeImpl(src) {
1880                 VectorOf(AttributeConsumingService) w=getAttributeConsumingServices();
1881                 for (vector<AttributeConsumingService*>::const_iterator j=src.m_AttributeConsumingServices.begin(); j!=src.m_AttributeConsumingServices.end(); j++) {
1882                     if (*j) {
1883                         w.push_back((*j)->cloneAttributeConsumingService());
1884                     }
1885                 }
1886             }
1887
1888             IMPL_XMLOBJECT_CLONE(AttributeQueryDescriptorType);
1889             QueryDescriptorType* cloneQueryDescriptorType() const {
1890                 return new AttributeQueryDescriptorTypeImpl(*this);
1891             }
1892             RoleDescriptor* cloneRoleDescriptor() const {
1893                 return new AttributeQueryDescriptorTypeImpl(*this);
1894             }
1895
1896             IMPL_TYPED_CHILDREN(AttributeConsumingService,m_children.end());
1897
1898         protected:
1899             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
1900                 PROC_TYPED_CHILDREN(AttributeConsumingService,SAML20MD_NS,false);
1901                 QueryDescriptorTypeImpl::processChildElement(childXMLObject,root);
1902             }
1903         };
1904
1905         class SAML_DLLLOCAL AuthzDecisionQueryDescriptorTypeImpl : public virtual AuthzDecisionQueryDescriptorType, public QueryDescriptorTypeImpl
1906         {
1907         public:
1908             virtual ~AuthzDecisionQueryDescriptorTypeImpl() {}
1909
1910             AuthzDecisionQueryDescriptorTypeImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
1911                 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {}
1912
1913             AuthzDecisionQueryDescriptorTypeImpl(const AuthzDecisionQueryDescriptorTypeImpl& src)
1914                     : AbstractXMLObject(src), QueryDescriptorTypeImpl(src) {
1915                 VectorOf(ActionNamespace) w=getActionNamespaces();
1916                 for (vector<ActionNamespace*>::const_iterator j=src.m_ActionNamespaces.begin(); j!=src.m_ActionNamespaces.end(); j++) {
1917                     if (*j) {
1918                         w.push_back((*j)->cloneActionNamespace());
1919                     }
1920                 }
1921             }
1922
1923             IMPL_XMLOBJECT_CLONE(AuthzDecisionQueryDescriptorType);
1924             QueryDescriptorType* cloneQueryDescriptorType() const {
1925                 return new AuthzDecisionQueryDescriptorTypeImpl(*this);
1926             }
1927             RoleDescriptor* cloneRoleDescriptor() const {
1928                 return new AuthzDecisionQueryDescriptorTypeImpl(*this);
1929             }
1930
1931             IMPL_TYPED_CHILDREN(ActionNamespace,m_children.end());
1932
1933         protected:
1934             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
1935                 PROC_TYPED_CHILDREN(ActionNamespace,samlconstants::SAML20MD_QUERY_EXT_NS,false);
1936                 QueryDescriptorTypeImpl::processChildElement(childXMLObject,root);
1937             }
1938         };
1939
1940         class SAML_DLLLOCAL AffiliationDescriptorImpl : public virtual AffiliationDescriptor,
1941             public virtual SignableObject,
1942             public AbstractComplexElement,
1943             public AbstractAttributeExtensibleXMLObject,
1944             public AbstractDOMCachingXMLObject,
1945             public AbstractXMLObjectMarshaller,
1946             public AbstractXMLObjectUnmarshaller
1947         {
1948             list<XMLObject*>::iterator m_pos_AffiliateMember;
1949
1950             void init() {
1951                 m_ID=m_AffiliationOwnerID=nullptr;
1952                 m_ValidUntil=m_CacheDuration=nullptr;
1953                 m_children.push_back(nullptr);
1954                 m_children.push_back(nullptr);
1955                 m_children.push_back(nullptr);
1956                 m_Signature=nullptr;
1957                 m_Extensions=nullptr;
1958                 m_pos_Signature=m_children.begin();
1959                 m_pos_Extensions=m_pos_Signature;
1960                 ++m_pos_Extensions;
1961                 m_pos_AffiliateMember=m_pos_Extensions;
1962                 ++m_pos_AffiliateMember;
1963             }
1964
1965         public:
1966             virtual ~AffiliationDescriptorImpl() {
1967                 XMLString::release(&m_ID);
1968                 XMLString::release(&m_AffiliationOwnerID);
1969                 delete m_ValidUntil;
1970                 delete m_CacheDuration;
1971             }
1972
1973             AffiliationDescriptorImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
1974                 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
1975                 init();
1976             }
1977
1978             AffiliationDescriptorImpl(const AffiliationDescriptorImpl& src)
1979                     : AbstractXMLObject(src), AbstractComplexElement(src),
1980                         AbstractAttributeExtensibleXMLObject(src), AbstractDOMCachingXMLObject(src) {
1981                 init();
1982                 setID(src.getID());
1983                 setAffiliationOwnerID(src.getAffiliationOwnerID());
1984                 setValidUntil(src.getValidUntil());
1985                 setCacheDuration(src.getCacheDuration());
1986                 if (src.getSignature())
1987                     setSignature(src.getSignature()->cloneSignature());
1988                 if (src.getExtensions())
1989                     setExtensions(src.getExtensions()->cloneExtensions());
1990
1991                 VectorOf(KeyDescriptor) v=getKeyDescriptors();
1992                 for (vector<KeyDescriptor*>::const_iterator i=src.m_KeyDescriptors.begin(); i!=src.m_KeyDescriptors.end(); i++) {
1993                     if (*i) {
1994                         v.push_back((*i)->cloneKeyDescriptor());
1995                     }
1996                 }
1997                 VectorOf(AffiliateMember) w=getAffiliateMembers();
1998                 for (vector<AffiliateMember*>::const_iterator j=src.m_AffiliateMembers.begin(); j!=src.m_AffiliateMembers.end(); j++) {
1999                     if (*j) {
2000                         w.push_back((*j)->cloneAffiliateMember());
2001                     }
2002                 }
2003             }
2004
2005             IMPL_XMLOBJECT_CLONE(AffiliationDescriptor);
2006
2007             //IMPL_TYPED_CHILD(Signature);
2008             // Need customized setter.
2009         protected:
2010             Signature* m_Signature;
2011             list<XMLObject*>::iterator m_pos_Signature;
2012         public:
2013             Signature* getSignature() const {
2014                 return m_Signature;
2015             }
2016
2017             void setSignature(Signature* sig) {
2018                 prepareForAssignment(m_Signature,sig);
2019                 *m_pos_Signature=m_Signature=sig;
2020                 // Sync content reference back up.
2021                 if (m_Signature)
2022                     m_Signature->setContentReference(new opensaml::ContentReference(*this));
2023             }
2024
2025             IMPL_ID_ATTRIB_EX(ID,ID,nullptr);
2026             IMPL_STRING_ATTRIB(AffiliationOwnerID);
2027             IMPL_DATETIME_ATTRIB(ValidUntil,SAMLTIME_MAX);
2028             IMPL_DURATION_ATTRIB(CacheDuration,0);
2029             IMPL_TYPED_CHILD(Extensions);
2030             IMPL_TYPED_CHILDREN(AffiliateMember,m_pos_AffiliateMember);
2031             IMPL_TYPED_CHILDREN(KeyDescriptor,m_children.end());
2032
2033             void setAttribute(const xmltooling::QName& qualifiedName, const XMLCh* value, bool ID=false) {
2034                 if (!qualifiedName.hasNamespaceURI()) {
2035                     if (XMLString::equals(qualifiedName.getLocalPart(),ID_ATTRIB_NAME)) {
2036                         setID(value);
2037                         return;
2038                     }
2039                     else if (XMLString::equals(qualifiedName.getLocalPart(),AFFILIATIONOWNERID_ATTRIB_NAME)) {
2040                         setAffiliationOwnerID(value);
2041                         return;
2042                     }
2043                     else if (XMLString::equals(qualifiedName.getLocalPart(),VALIDUNTIL_ATTRIB_NAME)) {
2044                         setValidUntil(value);
2045                         return;
2046                     }
2047                     else if (XMLString::equals(qualifiedName.getLocalPart(),CACHEDURATION_ATTRIB_NAME)) {
2048                         setCacheDuration(value);
2049                         return;
2050                     }
2051                 }
2052                 AbstractAttributeExtensibleXMLObject::setAttribute(qualifiedName, value, ID);
2053             }
2054
2055         protected:
2056             void prepareForMarshalling() const {
2057                 if (m_Signature)
2058                     declareNonVisibleNamespaces();
2059             }
2060
2061             void marshallAttributes(DOMElement* domElement) const {
2062                 MARSHALL_ID_ATTRIB(ID,ID,nullptr);
2063                 MARSHALL_STRING_ATTRIB(AffiliationOwnerID,AFFILIATIONOWNERID,nullptr);
2064                 MARSHALL_DATETIME_ATTRIB(ValidUntil,VALIDUNTIL,nullptr);
2065                 MARSHALL_DATETIME_ATTRIB(CacheDuration,CACHEDURATION,nullptr);
2066                 marshallExtensionAttributes(domElement);
2067             }
2068
2069             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
2070                 PROC_TYPED_FOREIGN_CHILD(Signature,xmlsignature,XMLSIG_NS,false);
2071                 PROC_TYPED_CHILD(Extensions,SAML20MD_NS,false);
2072                 PROC_TYPED_CHILDREN(AffiliateMember,SAML20MD_NS,false);
2073                 PROC_TYPED_CHILDREN(KeyDescriptor,SAML20MD_NS,false);
2074                 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
2075             }
2076
2077             void processAttribute(const DOMAttr* attribute) {
2078                 PROC_ID_ATTRIB(ID,ID,nullptr);
2079                 unmarshallExtensionAttribute(attribute);
2080             }
2081         };
2082
2083         class SAML_DLLLOCAL EntityDescriptorImpl : public virtual EntityDescriptor,
2084             public virtual SignableObject,
2085             public AbstractComplexElement,
2086             public AbstractAttributeExtensibleXMLObject,
2087             public AbstractDOMCachingXMLObject,
2088             public AbstractXMLObjectMarshaller,
2089             public AbstractXMLObjectUnmarshaller
2090         {
2091             list<XMLObject*>::iterator m_pos_ContactPerson;
2092
2093             void init() {
2094                 m_ID=m_EntityID=nullptr;
2095                 m_ValidUntil=m_CacheDuration=nullptr;
2096                 m_children.push_back(nullptr);
2097                 m_children.push_back(nullptr);
2098                 m_children.push_back(nullptr);
2099                 m_children.push_back(nullptr);
2100                 m_children.push_back(nullptr);
2101                 m_Signature=nullptr;
2102                 m_Extensions=nullptr;
2103                 m_AffiliationDescriptor=nullptr;
2104                 m_Organization=nullptr;
2105                 m_pos_Signature=m_children.begin();
2106                 m_pos_Extensions=m_pos_Signature;
2107                 ++m_pos_Extensions;
2108                 m_pos_AffiliationDescriptor=m_pos_Extensions;
2109                 ++m_pos_AffiliationDescriptor;
2110                 m_pos_Organization=m_pos_AffiliationDescriptor;
2111                 ++m_pos_Organization;
2112                 m_pos_ContactPerson=m_pos_Organization;
2113                 ++m_pos_ContactPerson;
2114             }
2115
2116         public:
2117             virtual ~EntityDescriptorImpl() {
2118                 XMLString::release(&m_ID);
2119                 XMLString::release(&m_EntityID);
2120                 delete m_ValidUntil;
2121                 delete m_CacheDuration;
2122             }
2123
2124             EntityDescriptorImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
2125                 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
2126                 init();
2127             }
2128
2129             EntityDescriptorImpl(const EntityDescriptorImpl& src)
2130                     : AbstractXMLObject(src), AbstractComplexElement(src),
2131                         AbstractAttributeExtensibleXMLObject(src), AbstractDOMCachingXMLObject(src) {
2132                 init();
2133                 setID(src.getID());
2134                 setEntityID(src.getEntityID());
2135                 setValidUntil(src.getValidUntil());
2136                 setCacheDuration(src.getCacheDuration());
2137                 if (src.getSignature())
2138                     setSignature(src.getSignature()->cloneSignature());
2139                 if (src.getExtensions())
2140                     setExtensions(src.getExtensions()->cloneExtensions());
2141                 if (src.getAffiliationDescriptor())
2142                     setAffiliationDescriptor(src.getAffiliationDescriptor()->cloneAffiliationDescriptor());
2143                 if (src.getOrganization())
2144                     setOrganization(src.getOrganization()->cloneOrganization());
2145
2146                 for (list<XMLObject*>::const_iterator i=src.m_children.begin(); i!=src.m_children.end(); i++) {
2147                     if (*i) {
2148                         IDPSSODescriptor* idp=dynamic_cast<IDPSSODescriptor*>(*i);
2149                         if (idp) {
2150                             getIDPSSODescriptors().push_back(idp->cloneIDPSSODescriptor());
2151                             continue;
2152                         }
2153
2154                         SPSSODescriptor* sp=dynamic_cast<SPSSODescriptor*>(*i);
2155                         if (sp) {
2156                             getSPSSODescriptors().push_back(sp->cloneSPSSODescriptor());
2157                             continue;
2158                         }
2159
2160                         AuthnAuthorityDescriptor* authn=dynamic_cast<AuthnAuthorityDescriptor*>(*i);
2161                         if (authn) {
2162                             getAuthnAuthorityDescriptors().push_back(authn->cloneAuthnAuthorityDescriptor());
2163                             continue;
2164                         }
2165
2166                         AttributeAuthorityDescriptor* attr=dynamic_cast<AttributeAuthorityDescriptor*>(*i);
2167                         if (attr) {
2168                             getAttributeAuthorityDescriptors().push_back(attr->cloneAttributeAuthorityDescriptor());
2169                             continue;
2170                         }
2171
2172                         PDPDescriptor* pdp=dynamic_cast<PDPDescriptor*>(*i);
2173                         if (pdp) {
2174                             getPDPDescriptors().push_back(pdp->clonePDPDescriptor());
2175                             continue;
2176                         }
2177
2178                         AuthnQueryDescriptorType* authnq=dynamic_cast<AuthnQueryDescriptorType*>(*i);
2179                         if (authnq) {
2180                             getAuthnQueryDescriptorTypes().push_back(authnq->cloneAuthnQueryDescriptorType());
2181                             continue;
2182                         }
2183
2184                         AttributeQueryDescriptorType* attrq=dynamic_cast<AttributeQueryDescriptorType*>(*i);
2185                         if (attrq) {
2186                             getAttributeQueryDescriptorTypes().push_back(attrq->cloneAttributeQueryDescriptorType());
2187                             continue;
2188                         }
2189
2190                         AuthzDecisionQueryDescriptorType* authzq=dynamic_cast<AuthzDecisionQueryDescriptorType*>(*i);
2191                         if (authzq) {
2192                             getAuthzDecisionQueryDescriptorTypes().push_back(authzq->cloneAuthzDecisionQueryDescriptorType());
2193                             continue;
2194                         }
2195
2196                         RoleDescriptor* role=dynamic_cast<RoleDescriptor*>(*i);
2197                         if (role) {
2198                             getRoleDescriptors().push_back(role->cloneRoleDescriptor());
2199                             continue;
2200                         }
2201                     }
2202                 }
2203
2204                 VectorOf(ContactPerson) v=getContactPersons();
2205                 for (vector<ContactPerson*>::const_iterator j=src.m_ContactPersons.begin(); j!=src.m_ContactPersons.end(); j++) {
2206                     if (*j) {
2207                         v.push_back((*j)->cloneContactPerson());
2208                     }
2209                 }
2210                 VectorOf(AdditionalMetadataLocation) w=getAdditionalMetadataLocations();
2211                 for (vector<AdditionalMetadataLocation*>::const_iterator k=src.m_AdditionalMetadataLocations.begin(); k!=src.m_AdditionalMetadataLocations.end(); k++) {
2212                     if (*k) {
2213                         w.push_back((*k)->cloneAdditionalMetadataLocation());
2214                     }
2215                 }
2216             }
2217
2218             IMPL_XMLOBJECT_CLONE(EntityDescriptor);
2219
2220             //IMPL_TYPED_CHILD(Signature);
2221             // Need customized setter.
2222         protected:
2223             Signature* m_Signature;
2224             list<XMLObject*>::iterator m_pos_Signature;
2225         public:
2226             Signature* getSignature() const {
2227                 return m_Signature;
2228             }
2229
2230             void setSignature(Signature* sig) {
2231                 prepareForAssignment(m_Signature,sig);
2232                 *m_pos_Signature=m_Signature=sig;
2233                 // Sync content reference back up.
2234                 if (m_Signature)
2235                     m_Signature->setContentReference(new opensaml::ContentReference(*this));
2236             }
2237
2238             IMPL_ID_ATTRIB_EX(ID,ID,nullptr);
2239             IMPL_STRING_ATTRIB(EntityID);
2240             IMPL_DATETIME_ATTRIB(ValidUntil,SAMLTIME_MAX);
2241             IMPL_DURATION_ATTRIB(CacheDuration,0);
2242             IMPL_TYPED_CHILD(Extensions);
2243             IMPL_TYPED_CHILDREN(RoleDescriptor,m_pos_AffiliationDescriptor);
2244             IMPL_TYPED_CHILDREN(IDPSSODescriptor,m_pos_AffiliationDescriptor);
2245             IMPL_TYPED_CHILDREN(SPSSODescriptor,m_pos_AffiliationDescriptor);
2246             IMPL_TYPED_CHILDREN(AuthnAuthorityDescriptor,m_pos_AffiliationDescriptor);
2247             IMPL_TYPED_CHILDREN(AttributeAuthorityDescriptor,m_pos_AffiliationDescriptor);
2248             IMPL_TYPED_CHILDREN(PDPDescriptor,m_pos_AffiliationDescriptor);
2249             IMPL_TYPED_CHILDREN(AuthnQueryDescriptorType,m_pos_AffiliationDescriptor);
2250             IMPL_TYPED_CHILDREN(AttributeQueryDescriptorType,m_pos_AffiliationDescriptor);
2251             IMPL_TYPED_CHILDREN(AuthzDecisionQueryDescriptorType,m_pos_AffiliationDescriptor);
2252             IMPL_TYPED_CHILD(AffiliationDescriptor);
2253             IMPL_TYPED_CHILD(Organization);
2254             IMPL_TYPED_CHILDREN(ContactPerson,m_pos_ContactPerson);
2255             IMPL_TYPED_CHILDREN(AdditionalMetadataLocation,m_children.end());
2256
2257             void setAttribute(const xmltooling::QName& qualifiedName, const XMLCh* value, bool ID=false) {
2258                 if (!qualifiedName.hasNamespaceURI()) {
2259                     if (XMLString::equals(qualifiedName.getLocalPart(),ID_ATTRIB_NAME)) {
2260                         setID(value);
2261                         return;
2262                     }
2263                     else if (XMLString::equals(qualifiedName.getLocalPart(),ENTITYID_ATTRIB_NAME)) {
2264                         setEntityID(value);
2265                         return;
2266                     }
2267                     else if (XMLString::equals(qualifiedName.getLocalPart(),VALIDUNTIL_ATTRIB_NAME)) {
2268                         setValidUntil(value);
2269                         return;
2270                     }
2271                     else if (XMLString::equals(qualifiedName.getLocalPart(),CACHEDURATION_ATTRIB_NAME)) {
2272                         setCacheDuration(value);
2273                         return;
2274                     }
2275                 }
2276                 AbstractAttributeExtensibleXMLObject::setAttribute(qualifiedName, value, ID);
2277             }
2278
2279             const RoleDescriptor* getRoleDescriptor(const xmltooling::QName& qname, const XMLCh* protocol) const {
2280                 // Check for "known" elements/types.
2281                 if (qname == IDPSSODescriptor::ELEMENT_QNAME)
2282                     return find_if(m_IDPSSODescriptors, isValidForProtocol(protocol));
2283                 if (qname == SPSSODescriptor::ELEMENT_QNAME)
2284                     return find_if(m_SPSSODescriptors, isValidForProtocol(protocol));
2285                 if (qname == AuthnAuthorityDescriptor::ELEMENT_QNAME)
2286                     return find_if(m_AuthnAuthorityDescriptors, isValidForProtocol(protocol));
2287                 if (qname == AttributeAuthorityDescriptor::ELEMENT_QNAME)
2288                     return find_if(m_AttributeAuthorityDescriptors, isValidForProtocol(protocol));
2289                 if (qname == PDPDescriptor::ELEMENT_QNAME)
2290                     return find_if(m_PDPDescriptors, isValidForProtocol(protocol));
2291                 if (qname == AuthnQueryDescriptorType::TYPE_QNAME)
2292                     return find_if(m_AuthnQueryDescriptorTypes, isValidForProtocol(protocol));
2293                 if (qname == AttributeQueryDescriptorType::TYPE_QNAME)
2294                     return find_if(m_AttributeQueryDescriptorTypes, isValidForProtocol(protocol));
2295                 if (qname == AuthzDecisionQueryDescriptorType::TYPE_QNAME)
2296                     return find_if(m_AuthzDecisionQueryDescriptorTypes, isValidForProtocol(protocol));
2297
2298                 vector<RoleDescriptor*>::const_iterator i =
2299                     find_if(m_RoleDescriptors.begin(), m_RoleDescriptors.end(), ofTypeValidForProtocol(qname,protocol));
2300                 return (i!=m_RoleDescriptors.end()) ? *i : nullptr;
2301             }
2302
2303         protected:
2304             void prepareForMarshalling() const {
2305                 if (m_Signature)
2306                     declareNonVisibleNamespaces();
2307             }
2308
2309             void marshallAttributes(DOMElement* domElement) const {
2310                 MARSHALL_ID_ATTRIB(ID,ID,nullptr);
2311                 MARSHALL_STRING_ATTRIB(EntityID,ENTITYID,nullptr);
2312                 MARSHALL_DATETIME_ATTRIB(ValidUntil,VALIDUNTIL,nullptr);
2313                 MARSHALL_DATETIME_ATTRIB(CacheDuration,CACHEDURATION,nullptr);
2314                 marshallExtensionAttributes(domElement);
2315             }
2316
2317             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
2318                 PROC_TYPED_FOREIGN_CHILD(Signature,xmlsignature,XMLSIG_NS,false);
2319                 PROC_TYPED_CHILD(Extensions,SAML20MD_NS,false);
2320                 PROC_TYPED_CHILDREN(IDPSSODescriptor,SAML20MD_NS,false);
2321                 PROC_TYPED_CHILDREN(SPSSODescriptor,SAML20MD_NS,false);
2322                 PROC_TYPED_CHILDREN(AuthnAuthorityDescriptor,SAML20MD_NS,false);
2323                 PROC_TYPED_CHILDREN(AttributeAuthorityDescriptor,SAML20MD_NS,false);
2324                 PROC_TYPED_CHILDREN(PDPDescriptor,SAML20MD_NS,false);
2325                 PROC_TYPED_CHILDREN(AuthnQueryDescriptorType,samlconstants::SAML20MD_QUERY_EXT_NS,false);
2326                 PROC_TYPED_CHILDREN(AttributeQueryDescriptorType,samlconstants::SAML20MD_QUERY_EXT_NS,false);
2327                 PROC_TYPED_CHILDREN(AuthzDecisionQueryDescriptorType,samlconstants::SAML20MD_QUERY_EXT_NS,false);
2328                 PROC_TYPED_CHILDREN(RoleDescriptor,SAML20MD_NS,false);
2329                 PROC_TYPED_CHILD(AffiliationDescriptor,SAML20MD_NS,false);
2330                 PROC_TYPED_CHILD(Organization,SAML20MD_NS,false);
2331                 PROC_TYPED_CHILDREN(ContactPerson,SAML20MD_NS,false);
2332                 PROC_TYPED_CHILDREN(AdditionalMetadataLocation,SAML20MD_NS,false);
2333                 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
2334             }
2335
2336             void processAttribute(const DOMAttr* attribute) {
2337                 PROC_ID_ATTRIB(ID,ID,nullptr);
2338                 unmarshallExtensionAttribute(attribute);
2339             }
2340         };
2341
2342         class SAML_DLLLOCAL EntitiesDescriptorImpl : public virtual EntitiesDescriptor,
2343             public virtual SignableObject,
2344             public AbstractComplexElement,
2345             public AbstractDOMCachingXMLObject,
2346             public AbstractXMLObjectMarshaller,
2347             public AbstractXMLObjectUnmarshaller
2348         {
2349             void init() {
2350                 m_ID=m_Name=nullptr;
2351                 m_ValidUntil=m_CacheDuration=nullptr;
2352                 m_children.push_back(nullptr);
2353                 m_children.push_back(nullptr);
2354                 m_Signature=nullptr;
2355                 m_Extensions=nullptr;
2356                 m_pos_Signature=m_children.begin();
2357                 m_pos_Extensions=m_pos_Signature;
2358                 ++m_pos_Extensions;
2359             }
2360
2361         public:
2362             virtual ~EntitiesDescriptorImpl() {
2363                 XMLString::release(&m_ID);
2364                 XMLString::release(&m_Name);
2365                 delete m_ValidUntil;
2366                 delete m_CacheDuration;
2367             }
2368
2369             EntitiesDescriptorImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
2370                 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
2371                 init();
2372             }
2373
2374             EntitiesDescriptorImpl(const EntitiesDescriptorImpl& src)
2375                     : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
2376                 init();
2377                 setID(src.getID());
2378                 setName(src.getName());
2379                 setValidUntil(src.getValidUntil());
2380                 setCacheDuration(src.getCacheDuration());
2381                 if (src.getSignature())
2382                     setSignature(src.getSignature()->cloneSignature());
2383                 if (src.getExtensions())
2384                     setExtensions(src.getExtensions()->cloneExtensions());
2385
2386                 for (list<XMLObject*>::const_iterator i=src.m_children.begin(); i!=src.m_children.end(); i++) {
2387                     if (*i) {
2388                         EntityDescriptor* e=dynamic_cast<EntityDescriptor*>(*i);
2389                         if (e) {
2390                             getEntityDescriptors().push_back(e->cloneEntityDescriptor());
2391                             continue;
2392                         }
2393
2394                         EntitiesDescriptor* es=dynamic_cast<EntitiesDescriptor*>(*i);
2395                         if (es) {
2396                             getEntitiesDescriptors().push_back(es->cloneEntitiesDescriptor());
2397                             continue;
2398                         }
2399                     }
2400                 }
2401             }
2402
2403             IMPL_XMLOBJECT_CLONE(EntitiesDescriptor);
2404
2405             //IMPL_TYPED_CHILD(Signature);
2406             // Need customized setter.
2407         protected:
2408             Signature* m_Signature;
2409             list<XMLObject*>::iterator m_pos_Signature;
2410         public:
2411             Signature* getSignature() const {
2412                 return m_Signature;
2413             }
2414
2415             void setSignature(Signature* sig) {
2416                 prepareForAssignment(m_Signature,sig);
2417                 *m_pos_Signature=m_Signature=sig;
2418                 // Sync content reference back up.
2419                 if (m_Signature)
2420                     m_Signature->setContentReference(new opensaml::ContentReference(*this));
2421             }
2422
2423             IMPL_ID_ATTRIB_EX(ID,ID,nullptr);
2424             IMPL_STRING_ATTRIB(Name);
2425             IMPL_DATETIME_ATTRIB(ValidUntil,SAMLTIME_MAX);
2426             IMPL_DURATION_ATTRIB(CacheDuration,0);
2427             IMPL_TYPED_CHILD(Extensions);
2428             IMPL_TYPED_CHILDREN(EntityDescriptor,m_children.end());
2429             IMPL_TYPED_CHILDREN(EntitiesDescriptor,m_children.end());
2430
2431         protected:
2432             void prepareForMarshalling() const {
2433                 if (m_Signature)
2434                     declareNonVisibleNamespaces();
2435             }
2436
2437             void marshallAttributes(DOMElement* domElement) const {
2438                 MARSHALL_ID_ATTRIB(ID,ID,nullptr);
2439                 MARSHALL_STRING_ATTRIB(Name,NAME,nullptr);
2440                 MARSHALL_DATETIME_ATTRIB(ValidUntil,VALIDUNTIL,nullptr);
2441                 MARSHALL_DATETIME_ATTRIB(CacheDuration,CACHEDURATION,nullptr);
2442             }
2443
2444             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
2445                 PROC_TYPED_FOREIGN_CHILD(Signature,xmlsignature,XMLSIG_NS,false);
2446                 PROC_TYPED_CHILD(Extensions,SAML20MD_NS,false);
2447                 PROC_TYPED_CHILDREN(EntityDescriptor,SAML20MD_NS,false);
2448                 PROC_TYPED_CHILDREN(EntitiesDescriptor,SAML20MD_NS,false);
2449                 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
2450             }
2451
2452             void processAttribute(const DOMAttr* attribute) {
2453                 PROC_ID_ATTRIB(ID,ID,nullptr);
2454                 PROC_STRING_ATTRIB(Name,NAME,nullptr);
2455                 PROC_DATETIME_ATTRIB(ValidUntil,VALIDUNTIL,nullptr);
2456                 PROC_DATETIME_ATTRIB(CacheDuration,CACHEDURATION,nullptr);
2457             }
2458         };
2459
2460         class SAML_DLLLOCAL EntityAttributesImpl : public virtual EntityAttributes,
2461             public AbstractComplexElement,
2462             public AbstractDOMCachingXMLObject,
2463             public AbstractXMLObjectMarshaller,
2464             public AbstractXMLObjectUnmarshaller
2465         {
2466         public:
2467             virtual ~EntityAttributesImpl() {}
2468
2469             EntityAttributesImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
2470                 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
2471             }
2472
2473             EntityAttributesImpl(const EntityAttributesImpl& src)
2474                     : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
2475                 for (list<XMLObject*>::const_iterator i=src.m_children.begin(); i!=src.m_children.end(); i++) {
2476                     if (*i) {
2477                         Attribute* a=dynamic_cast<Attribute*>(*i);
2478                         if (a) {
2479                             getAttributes().push_back(a->cloneAttribute());
2480                             continue;
2481                         }
2482
2483                         saml2::Assertion* as=dynamic_cast<saml2::Assertion*>(*i);
2484                         if (as) {
2485                             getAssertions().push_back(as->cloneAssertion());
2486                             continue;
2487                         }
2488                     }
2489                 }
2490             }
2491
2492             IMPL_XMLOBJECT_CLONE(EntityAttributes);
2493
2494             IMPL_TYPED_FOREIGN_CHILDREN(Attribute,saml2,m_children.end());
2495             IMPL_TYPED_FOREIGN_CHILDREN(Assertion,saml2,m_children.end());
2496
2497         protected:
2498             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
2499                 PROC_TYPED_FOREIGN_CHILDREN(Attribute,saml2,SAML20_NS,false);
2500                 PROC_TYPED_FOREIGN_CHILDREN(Assertion,saml2,SAML20_NS,false);
2501                 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
2502             }
2503         };
2504     };
2505 };
2506
2507 #if defined (_MSC_VER)
2508     #pragma warning( pop )
2509 #endif
2510
2511 IMPL_ELEMENT_QNAME(IDPSSODescriptor, SAML20MD_NS, SAML20MD_PREFIX);
2512 IMPL_ELEMENT_QNAME(SPSSODescriptor, SAML20MD_NS, SAML20MD_PREFIX);
2513 IMPL_ELEMENT_QNAME(AuthnAuthorityDescriptor, SAML20MD_NS, SAML20MD_PREFIX);
2514 IMPL_ELEMENT_QNAME(AttributeAuthorityDescriptor, SAML20MD_NS, SAML20MD_PREFIX);
2515 IMPL_ELEMENT_QNAME(PDPDescriptor, SAML20MD_NS, SAML20MD_PREFIX);
2516 IMPL_TYPE_QNAME(AuthnQueryDescriptorType, SAML20MD_QUERY_EXT_NS, SAML20MD_QUERY_EXT_PREFIX);
2517 IMPL_TYPE_QNAME(AttributeQueryDescriptorType, SAML20MD_QUERY_EXT_NS, SAML20MD_QUERY_EXT_PREFIX);
2518 IMPL_TYPE_QNAME(AuthzDecisionQueryDescriptorType, SAML20MD_QUERY_EXT_NS, SAML20MD_QUERY_EXT_PREFIX);
2519
2520 // Builder Implementations
2521
2522 IMPL_XMLOBJECTBUILDER(AdditionalMetadataLocation);
2523 IMPL_XMLOBJECTBUILDER(AffiliateMember);
2524 IMPL_XMLOBJECTBUILDER(AffiliationDescriptor);
2525 IMPL_XMLOBJECTBUILDER(ArtifactResolutionService);
2526 IMPL_XMLOBJECTBUILDER(AssertionConsumerService);
2527 IMPL_XMLOBJECTBUILDER(AssertionIDRequestService);
2528 IMPL_XMLOBJECTBUILDER(AttributeAuthorityDescriptor);
2529 IMPL_XMLOBJECTBUILDER(AttributeConsumingService);
2530 IMPL_XMLOBJECTBUILDER(AttributeProfile);
2531 IMPL_XMLOBJECTBUILDER(AttributeQueryDescriptorType);
2532 IMPL_XMLOBJECTBUILDER(AttributeService);
2533 IMPL_XMLOBJECTBUILDER(AuthnAuthorityDescriptor);
2534 IMPL_XMLOBJECTBUILDER(AuthnQueryDescriptorType);
2535 IMPL_XMLOBJECTBUILDER(AuthnQueryService);
2536 IMPL_XMLOBJECTBUILDER(AuthzDecisionQueryDescriptorType);
2537 IMPL_XMLOBJECTBUILDER(AuthzService);
2538 IMPL_XMLOBJECTBUILDER(Company);
2539 IMPL_XMLOBJECTBUILDER(ContactPerson);
2540 IMPL_XMLOBJECTBUILDER(EmailAddress);
2541 IMPL_XMLOBJECTBUILDER(EndpointType);
2542 IMPL_XMLOBJECTBUILDER(EntitiesDescriptor);
2543 IMPL_XMLOBJECTBUILDER(EntityDescriptor);
2544 IMPL_XMLOBJECTBUILDER(Extensions);
2545 IMPL_XMLOBJECTBUILDER(GivenName);
2546 IMPL_XMLOBJECTBUILDER(IDPSSODescriptor);
2547 IMPL_XMLOBJECTBUILDER(IndexedEndpointType);
2548 IMPL_XMLOBJECTBUILDER(KeyDescriptor);
2549 IMPL_XMLOBJECTBUILDER(localizedNameType);
2550 IMPL_XMLOBJECTBUILDER(localizedURIType);
2551 IMPL_XMLOBJECTBUILDER(ManageNameIDService);
2552 IMPL_XMLOBJECTBUILDER(NameIDFormat);
2553 IMPL_XMLOBJECTBUILDER(NameIDMappingService);
2554 IMPL_XMLOBJECTBUILDER(Organization);
2555 IMPL_XMLOBJECTBUILDER(OrganizationName);
2556 IMPL_XMLOBJECTBUILDER(OrganizationDisplayName);
2557 IMPL_XMLOBJECTBUILDER(OrganizationURL);
2558 IMPL_XMLOBJECTBUILDER(PDPDescriptor);
2559 IMPL_XMLOBJECTBUILDER(RequestedAttribute);
2560 IMPL_XMLOBJECTBUILDER(ServiceDescription);
2561 IMPL_XMLOBJECTBUILDER(ServiceName);
2562 IMPL_XMLOBJECTBUILDER(SingleLogoutService);
2563 IMPL_XMLOBJECTBUILDER(SingleSignOnService);
2564 IMPL_XMLOBJECTBUILDER(SPSSODescriptor);
2565 IMPL_XMLOBJECTBUILDER(SurName);
2566 IMPL_XMLOBJECTBUILDER(TelephoneNumber);
2567
2568 IMPL_XMLOBJECTBUILDER(ActionNamespace);
2569 IMPL_XMLOBJECTBUILDER(SourceID);
2570 IMPL_XMLOBJECTBUILDER(EntityAttributes);
2571
2572 #ifdef HAVE_COVARIANT_RETURNS
2573 RoleDescriptor* RoleDescriptorBuilder::buildObject(
2574 #else
2575 xmltooling::XMLObject* RoleDescriptorBuilder::buildObject(
2576 #endif
2577     const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType
2578     ) const
2579 {
2580     return new RoleDescriptorTypeImpl(nsURI,localName,prefix,schemaType);
2581 }
2582
2583 const XMLCh ActionNamespace::LOCAL_NAME[] =             UNICODE_LITERAL_15(A,c,t,i,o,n,N,a,m,e,s,p,a,c,e);
2584 const XMLCh AdditionalMetadataLocation::LOCAL_NAME[] =  UNICODE_LITERAL_26(A,d,d,i,t,i,o,n,a,l,M,e,t,a,d,a,t,a,L,o,c,a,t,i,o,n);
2585 const XMLCh AdditionalMetadataLocation::TYPE_NAME[] =   UNICODE_LITERAL_30(A,d,d,i,t,i,o,n,a,l,M,e,t,a,d,a,t,a,L,o,c,a,t,i,o,n,T,y,p,e);
2586 const XMLCh AdditionalMetadataLocation::NAMESPACE_ATTRIB_NAME[] =   UNICODE_LITERAL_9(n,a,m,e,s,p,a,c,e);
2587 const XMLCh AffiliateMember::LOCAL_NAME[] =             UNICODE_LITERAL_15(A,f,f,i,l,i,a,t,e,M,e,m,b,e,r);
2588 const XMLCh AffiliationDescriptor::LOCAL_NAME[] =       UNICODE_LITERAL_21(A,f,f,i,l,i,a,t,i,o,n,D,e,s,c,r,i,p,t,o,r);
2589 const XMLCh AffiliationDescriptor::TYPE_NAME[] =        UNICODE_LITERAL_25(A,f,f,i,l,i,a,t,i,o,n,D,e,s,c,r,i,p,t,o,r,T,y,p,e);
2590 const XMLCh AffiliationDescriptor::ID_ATTRIB_NAME[] =   UNICODE_LITERAL_2(I,D);
2591 const XMLCh AffiliationDescriptor::AFFILIATIONOWNERID_ATTRIB_NAME[] =   UNICODE_LITERAL_18(a,f,f,i,l,i,a,t,i,o,n,O,w,n,e,r,I,D);
2592 const XMLCh ArtifactResolutionService::LOCAL_NAME[] =   UNICODE_LITERAL_25(A,r,t,i,f,a,c,t,R,e,s,o,l,u,t,i,o,n,S,e,r,v,i,c,e);
2593 const XMLCh AssertionConsumerService::LOCAL_NAME[] =    UNICODE_LITERAL_24(A,s,s,e,r,t,i,o,n,C,o,n,s,u,m,e,r,S,e,r,v,i,c,e);
2594 const XMLCh AssertionIDRequestService::LOCAL_NAME[] =   UNICODE_LITERAL_25(A,s,s,e,r,t,i,o,n,I,D,R,e,q,u,e,s,t,S,e,r,v,i,c,e);
2595 const XMLCh AttributeAuthorityDescriptor::LOCAL_NAME[] =UNICODE_LITERAL_28(A,t,t,r,i,b,u,t,e,A,u,t,h,o,r,i,t,y,D,e,s,c,r,i,p,t,o,r);
2596 const XMLCh AttributeAuthorityDescriptor::TYPE_NAME[] = UNICODE_LITERAL_32(A,t,t,r,i,b,u,t,e,A,u,t,h,o,r,i,t,y,D,e,s,c,r,i,p,t,o,r,T,y,p,e);
2597 const XMLCh AttributeConsumingService::LOCAL_NAME[] =   UNICODE_LITERAL_25(A,t,t,r,i,b,u,t,e,C,o,n,s,u,m,i,n,g,S,e,r,v,i,c,e);
2598 const XMLCh AttributeConsumingService::TYPE_NAME[] =    UNICODE_LITERAL_29(A,t,t,r,i,b,u,t,e,C,o,n,s,u,m,i,n,g,S,e,r,v,i,c,e,T,y,p,e);
2599 const XMLCh AttributeConsumingService::INDEX_ATTRIB_NAME[] =    UNICODE_LITERAL_5(i,n,d,e,x);
2600 const XMLCh AttributeConsumingService::ISDEFAULT_ATTRIB_NAME[] =    UNICODE_LITERAL_9(i,s,D,e,f,a,u,l,t);
2601 const XMLCh AttributeProfile::LOCAL_NAME[] =            UNICODE_LITERAL_16(A,t,t,r,i,b,u,t,e,P,r,o,f,i,l,e);
2602 const XMLCh AttributeQueryDescriptorType::LOCAL_NAME[] =UNICODE_LITERAL_14(R,o,l,e,D,e,s,c,r,i,p,t,o,r);
2603 const XMLCh AttributeQueryDescriptorType::TYPE_NAME[] = UNICODE_LITERAL_28(A,t,t,r,i,b,u,t,e,Q,u,e,r,y,D,e,s,c,r,i,p,t,o,r,T,y,p,e);
2604 const XMLCh AttributeService::LOCAL_NAME[] =            UNICODE_LITERAL_16(A,t,t,r,i,b,u,t,e,S,e,r,v,i,c,e);
2605 const XMLCh AuthnAuthorityDescriptor::LOCAL_NAME[] =    UNICODE_LITERAL_24(A,u,t,h,n,A,u,t,h,o,r,i,t,y,D,e,s,c,r,i,p,t,o,r);
2606 const XMLCh AuthnAuthorityDescriptor::TYPE_NAME[] =     UNICODE_LITERAL_28(A,u,t,h,n,A,u,t,h,o,r,i,t,y,D,e,s,c,r,i,p,t,o,r,T,y,p,e);
2607 const XMLCh AuthnQueryDescriptorType::LOCAL_NAME[] =    UNICODE_LITERAL_14(R,o,l,e,D,e,s,c,r,i,p,t,o,r);
2608 const XMLCh AuthnQueryDescriptorType::TYPE_NAME[] =     UNICODE_LITERAL_24(A,u,t,h,n,Q,u,e,r,y,D,e,s,c,r,i,p,t,o,r,T,y,p,e);
2609 const XMLCh AuthnQueryService::LOCAL_NAME[] =           UNICODE_LITERAL_17(A,u,t,h,n,Q,u,e,r,y,S,e,r,v,i,c,e);
2610 const XMLCh AuthzDecisionQueryDescriptorType::LOCAL_NAME[] =    UNICODE_LITERAL_14(R,o,l,e,D,e,s,c,r,i,p,t,o,r);
2611 const XMLCh AuthzDecisionQueryDescriptorType::TYPE_NAME[] = UNICODE_LITERAL_32(A,u,t,h,z,D,e,c,i,s,i,o,n,Q,u,e,r,y,D,e,s,c,r,i,p,t,o,r,T,y,p,e);
2612 const XMLCh AuthzService::LOCAL_NAME[] =                UNICODE_LITERAL_12(A,u,t,h,z,S,e,r,v,i,c,e);
2613 const XMLCh CacheableSAMLObject::CACHEDURATION_ATTRIB_NAME[] =  UNICODE_LITERAL_13(c,a,c,h,e,D,u,r,a,t,i,o,n);
2614 const XMLCh Company::LOCAL_NAME[] =                     UNICODE_LITERAL_7(C,o,m,p,a,n,y);
2615 const XMLCh ContactPerson::LOCAL_NAME[] =               UNICODE_LITERAL_13(C,o,n,t,a,c,t,P,e,r,s,o,n);
2616 const XMLCh ContactPerson::TYPE_NAME[] =                UNICODE_LITERAL_11(C,o,n,t,a,c,t,T,y,p,e);
2617 const XMLCh ContactPerson::CONTACTTYPE_ATTRIB_NAME[] =  UNICODE_LITERAL_11(c,o,n,t,a,c,t,T,y,p,e);
2618 const XMLCh ContactPerson::CONTACT_TECHNICAL[] =        UNICODE_LITERAL_9(t,e,c,h,n,i,c,a,l);
2619 const XMLCh ContactPerson::CONTACT_SUPPORT[] =          UNICODE_LITERAL_7(s,u,p,p,o,r,t);
2620 const XMLCh ContactPerson::CONTACT_ADMINISTRATIVE[] =   UNICODE_LITERAL_14(a,d,m,i,n,i,s,t,r,a,t,i,v,e);
2621 const XMLCh ContactPerson::CONTACT_BILLING[] =          UNICODE_LITERAL_7(b,i,l,l,i,n,g);
2622 const XMLCh ContactPerson::CONTACT_OTHER[] =            UNICODE_LITERAL_5(o,t,h,e,r);
2623 const XMLCh EmailAddress::LOCAL_NAME[] =                UNICODE_LITERAL_12(E,m,a,i,l,A,d,d,r,e,s,s);
2624 const XMLCh EndpointType::LOCAL_NAME[] =                {chNull};
2625 const XMLCh EndpointType::TYPE_NAME[] =                 UNICODE_LITERAL_12(E,n,d,p,o,i,n,t,T,y,p,e);
2626 const XMLCh EndpointType::BINDING_ATTRIB_NAME[] =       UNICODE_LITERAL_7(B,i,n,d,i,n,g);
2627 const XMLCh EndpointType::LOCATION_ATTRIB_NAME[] =      UNICODE_LITERAL_8(L,o,c,a,t,i,o,n);
2628 const XMLCh EndpointType::RESPONSELOCATION_ATTRIB_NAME[] =  UNICODE_LITERAL_16(R,e,s,p,o,n,s,e,L,o,c,a,t,i,o,n);
2629 const XMLCh EntitiesDescriptor::LOCAL_NAME[] =          UNICODE_LITERAL_18(E,n,t,i,t,i,e,s,D,e,s,c,r,i,p,t,o,r);
2630 const XMLCh EntitiesDescriptor::TYPE_NAME[] =           UNICODE_LITERAL_22(E,n,t,i,t,i,e,s,D,e,s,c,r,i,p,t,o,r,T,y,p,e);
2631 const XMLCh EntitiesDescriptor::ID_ATTRIB_NAME[] =      UNICODE_LITERAL_2(I,D);
2632 const XMLCh EntitiesDescriptor::NAME_ATTRIB_NAME[] =    UNICODE_LITERAL_4(N,a,m,e);
2633 const XMLCh EntityDescriptor::LOCAL_NAME[] =            UNICODE_LITERAL_16(E,n,t,i,t,y,D,e,s,c,r,i,p,t,o,r);
2634 const XMLCh EntityDescriptor::TYPE_NAME[] =             UNICODE_LITERAL_20(E,n,t,i,t,y,D,e,s,c,r,i,p,t,o,r,T,y,p,e);
2635 const XMLCh EntityDescriptor::ID_ATTRIB_NAME[] =        UNICODE_LITERAL_2(I,D);
2636 const XMLCh EntityDescriptor::ENTITYID_ATTRIB_NAME[] =  UNICODE_LITERAL_8(e,n,t,i,t,y,I,D);
2637 const XMLCh EntityAttributes::LOCAL_NAME[] =            UNICODE_LITERAL_16(E,n,t,i,t,y,A,t,t,r,i,b,u,t,e,s);
2638 const XMLCh EntityAttributes::TYPE_NAME[] =             UNICODE_LITERAL_20(E,n,t,i,t,y,A,t,t,r,i,b,u,t,e,s,T,y,p,e);
2639 const XMLCh Extensions::LOCAL_NAME[] =                  UNICODE_LITERAL_10(E,x,t,e,n,s,i,o,n,s);
2640 const XMLCh Extensions::TYPE_NAME[] =                   UNICODE_LITERAL_14(E,x,t,e,n,s,i,o,n,s,T,y,p,e);
2641 const XMLCh GivenName::LOCAL_NAME[] =                   UNICODE_LITERAL_9(G,i,v,e,n,N,a,m,e);
2642 const XMLCh IDPSSODescriptor::LOCAL_NAME[] =            UNICODE_LITERAL_16(I,D,P,S,S,O,D,e,s,c,r,i,p,t,o,r);
2643 const XMLCh IDPSSODescriptor::TYPE_NAME[] =             UNICODE_LITERAL_20(I,D,P,S,S,O,D,e,s,c,r,i,p,t,o,r,T,y,p,e);
2644 const XMLCh IDPSSODescriptor::WANTAUTHNREQUESTSSIGNED_ATTRIB_NAME[] =   UNICODE_LITERAL_23(W,a,n,t,A,u,t,h,n,R,e,q,u,e,s,t,s,S,i,g,n,e,d);
2645 const XMLCh IndexedEndpointType::LOCAL_NAME[] =         {chNull};
2646 const XMLCh IndexedEndpointType::TYPE_NAME[] =          UNICODE_LITERAL_19(I,n,d,e,x,e,d,E,n,d,p,o,i,n,t,T,y,p,e);
2647 const XMLCh IndexedEndpointType::INDEX_ATTRIB_NAME[] =  UNICODE_LITERAL_5(i,n,d,e,x);
2648 const XMLCh IndexedEndpointType::ISDEFAULT_ATTRIB_NAME[] =  UNICODE_LITERAL_9(i,s,D,e,f,a,u,l,t);
2649 const XMLCh KeyDescriptor::LOCAL_NAME[] =               UNICODE_LITERAL_13(K,e,y,D,e,s,c,r,i,p,t,o,r);
2650 const XMLCh KeyDescriptor::TYPE_NAME[] =                UNICODE_LITERAL_17(K,e,y,D,e,s,c,r,i,p,t,o,r,T,y,p,e);
2651 const XMLCh KeyDescriptor::USE_ATTRIB_NAME[] =          UNICODE_LITERAL_3(u,s,e);
2652 const XMLCh KeyDescriptor::KEYTYPE_ENCRYPTION[] =       UNICODE_LITERAL_10(e,n,c,r,y,p,t,i,o,n);
2653 const XMLCh KeyDescriptor::KEYTYPE_SIGNING[] =          UNICODE_LITERAL_7(s,i,g,n,i,n,g);
2654 const XMLCh localizedNameType::LOCAL_NAME[] =           {chNull};
2655 const XMLCh localizedNameType::TYPE_NAME[] =            UNICODE_LITERAL_17(l,o,c,a,l,i,z,e,d,N,a,m,e,T,y,p,e);
2656 const XMLCh localizedNameType::LANG_ATTRIB_NAME[] =     UNICODE_LITERAL_4(l,a,n,g);
2657 const XMLCh localizedURIType::LOCAL_NAME[] =            {chNull};
2658 const XMLCh localizedURIType::TYPE_NAME[] =             UNICODE_LITERAL_16(l,o,c,a,l,i,z,e,d,U,R,I,T,y,p,e);
2659 const XMLCh localizedURIType::LANG_ATTRIB_NAME[] =      UNICODE_LITERAL_4(l,a,n,g);
2660 const XMLCh ManageNameIDService::LOCAL_NAME[] =         UNICODE_LITERAL_19(M,a,n,a,g,e,N,a,m,e,I,D,S,e,r,v,i,c,e);
2661 const XMLCh NameIDFormat::LOCAL_NAME[] =                UNICODE_LITERAL_12(N,a,m,e,I,D,F,o,r,m,a,t);
2662 const XMLCh NameIDMappingService::LOCAL_NAME[] =        UNICODE_LITERAL_20(N,a,m,e,I,D,M,a,p,p,i,n,g,S,e,r,v,i,c,e);
2663 const XMLCh Organization::LOCAL_NAME[] =                UNICODE_LITERAL_12(O,r,g,a,n,i,z,a,t,i,o,n);
2664 const XMLCh Organization::TYPE_NAME[] =                 UNICODE_LITERAL_16(O,r,g,a,n,i,z,a,t,i,o,n,T,y,p,e);
2665 const XMLCh OrganizationName::LOCAL_NAME[] =            UNICODE_LITERAL_16(O,r,g,a,n,i,z,a,t,i,o,n,N,a,m,e);
2666 const XMLCh OrganizationDisplayName::LOCAL_NAME[] =     UNICODE_LITERAL_23(O,r,g,a,n,i,z,a,t,i,o,n,D,i,s,p,l,a,y,N,a,m,e);
2667 const XMLCh OrganizationURL::LOCAL_NAME[] =             UNICODE_LITERAL_15(O,r,g,a,n,i,z,a,t,i,o,n,U,R,L);
2668 const XMLCh PDPDescriptor::LOCAL_NAME[] =               UNICODE_LITERAL_13(P,D,P,D,e,s,c,r,i,p,t,o,r);
2669 const XMLCh PDPDescriptor::TYPE_NAME[] =                UNICODE_LITERAL_17(P,D,P,D,e,s,c,r,i,p,t,o,r,T,y,p,e);
2670 const XMLCh QueryDescriptorType::LOCAL_NAME[] =         {chNull};
2671 const XMLCh QueryDescriptorType::TYPE_NAME[] =          UNICODE_LITERAL_19(Q,u,e,r,y,D,e,s,c,r,i,p,t,o,r,T,y,p,e);
2672 const XMLCh QueryDescriptorType::WANTASSERTIONSSIGNED_ATTRIB_NAME[] =   UNICODE_LITERAL_20(W,a,n,t,A,s,s,e,r,t,i,o,n,s,S,i,g,n,e,d);
2673 const XMLCh RequestedAttribute::LOCAL_NAME[] =          UNICODE_LITERAL_18(R,e,q,u,e,s,t,e,d,A,t,t,r,i,b,u,t,e);
2674 const XMLCh RequestedAttribute::TYPE_NAME[] =           UNICODE_LITERAL_22(R,e,q,u,e,s,t,e,d,A,t,t,r,i,b,u,t,e,T,y,p,e);
2675 const XMLCh RequestedAttribute::ISREQUIRED_ATTRIB_NAME[] =  UNICODE_LITERAL_10(i,s,R,e,q,u,i,r,e,d);
2676 const XMLCh RoleDescriptor::LOCAL_NAME[] =              UNICODE_LITERAL_14(R,o,l,e,D,e,s,c,r,i,p,t,o,r);
2677 const XMLCh RoleDescriptor::ID_ATTRIB_NAME[] =          UNICODE_LITERAL_2(I,D);
2678 const XMLCh RoleDescriptor::PROTOCOLSUPPORTENUMERATION_ATTRIB_NAME[] =  UNICODE_LITERAL_26(p,r,o,t,o,c,o,l,S,u,p,p,o,r,t,E,n,u,m,e,r,a,t,i,o,n);
2679 const XMLCh RoleDescriptor::ERRORURL_ATTRIB_NAME[] =    UNICODE_LITERAL_8(e,r,r,o,r,U,R,L);
2680 const XMLCh ServiceDescription::LOCAL_NAME[] =          UNICODE_LITERAL_18(S,e,r,v,i,c,e,D,e,s,c,r,i,p,t,i,o,n);
2681 const XMLCh ServiceName::LOCAL_NAME[] =                 UNICODE_LITERAL_11(S,e,r,v,i,c,e,N,a,m,e);
2682 const XMLCh SingleLogoutService::LOCAL_NAME[] =         UNICODE_LITERAL_19(S,i,n,g,l,e,L,o,g,o,u,t,S,e,r,v,i,c,e);
2683 const XMLCh SingleSignOnService::LOCAL_NAME[] =         UNICODE_LITERAL_19(S,i,n,g,l,e,S,i,g,n,O,n,S,e,r,v,i,c,e);
2684 const XMLCh SourceID::LOCAL_NAME[] =                    UNICODE_LITERAL_8(S,o,u,r,c,e,I,D);
2685 const XMLCh SPSSODescriptor::LOCAL_NAME[] =             UNICODE_LITERAL_15(S,P,S,S,O,D,e,s,c,r,i,p,t,o,r);
2686 const XMLCh SPSSODescriptor::TYPE_NAME[] =              UNICODE_LITERAL_19(S,P,S,S,O,D,e,s,c,r,i,p,t,o,r,T,y,p,e);
2687 const XMLCh SPSSODescriptor::AUTHNREQUESTSSIGNED_ATTRIB_NAME[] =    UNICODE_LITERAL_19(A,u,t,h,n,R,e,q,u,e,s,t,s,S,i,g,n,e,d);
2688 const XMLCh SPSSODescriptor::WANTASSERTIONSSIGNED_ATTRIB_NAME[] =   UNICODE_LITERAL_20(W,a,n,t,A,s,s,e,r,t,i,o,n,s,S,i,g,n,e,d);
2689 const XMLCh SSODescriptorType::LOCAL_NAME[] =           {chNull};
2690 const XMLCh SSODescriptorType::TYPE_NAME[] =            UNICODE_LITERAL_17(S,S,O,D,e,s,c,r,i,p,t,o,r,T,y,p,e);
2691 const XMLCh SurName::LOCAL_NAME[] =                     UNICODE_LITERAL_7(S,u,r,N,a,m,e);
2692 const XMLCh TelephoneNumber::LOCAL_NAME[] =             UNICODE_LITERAL_15(T,e,l,e,p,h,o,n,e,N,u,m,b,e,r);
2693 const XMLCh TimeBoundSAMLObject::VALIDUNTIL_ATTRIB_NAME[] =   UNICODE_LITERAL_10(v,a,l,i,d,U,n,t,i,l);