Reducing header overuse, non-inlining selected methods (CPPOST-35).
[shibboleth/cpp-opensaml.git] / saml / saml2 / metadata / impl / MetadataImpl.cpp
1 /*
2  *  Copyright 2001-2009 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=NULL;
81                 m_LangPrefix=NULL;
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=NULL;
142                 m_LangPrefix=NULL;
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(NULL);
323                 m_children.push_back(NULL);
324                 m_children.push_back(NULL);
325                 m_Extensions=NULL;
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=NULL;
401                 m_children.push_back(NULL);
402                 m_children.push_back(NULL);
403                 m_children.push_back(NULL);
404                 m_children.push_back(NULL);
405                 m_children.push_back(NULL);
406                 m_Extensions=NULL;
407                 m_Company=NULL;
408                 m_GivenName=NULL;
409                 m_SurName=NULL;
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,NULL);
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=NULL;
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,NULL);
528             }
529
530             void processAttribute(const DOMAttr* attribute) {
531                 PROC_STRING_ATTRIB(Namespace,NAMESPACE,NULL);
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=NULL;
544                 m_KeyInfo=NULL;
545                 m_children.push_back(NULL);
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,NULL);
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,NULL);
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=NULL;
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,NULL);
660                 MARSHALL_STRING_ATTRIB(Location,LOCATION,NULL);
661                 MARSHALL_STRING_ATTRIB(ResponseLocation,RESPONSELOCATION,NULL);
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=NULL;
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,NULL);
729                 MARSHALL_BOOLEAN_ATTRIB(isDefault,ISDEFAULT,NULL);
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=NULL;
910                 m_ValidUntil=m_CacheDuration=NULL;
911                 m_children.push_back(NULL);
912                 m_children.push_back(NULL);
913                 m_children.push_back(NULL);
914                 m_children.push_back(NULL);
915                 m_Signature=NULL;
916                 m_Extensions=NULL;
917                 m_Organization=NULL;
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(ID);
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 marshallAttributes(DOMElement* domElement) const {
1090                 MARSHALL_ID_ATTRIB(ID,ID,NULL);
1091                 MARSHALL_STRING_ATTRIB(ProtocolSupportEnumeration,PROTOCOLSUPPORTENUMERATION,NULL);
1092                 MARSHALL_STRING_ATTRIB(ErrorURL,ERRORURL,NULL);
1093                 MARSHALL_DATETIME_ATTRIB(ValidUntil,VALIDUNTIL,NULL);
1094                 MARSHALL_DATETIME_ATTRIB(CacheDuration,CACHEDURATION,NULL);
1095                 marshallExtensionAttributes(domElement);
1096             }
1097
1098             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
1099                 PROC_TYPED_FOREIGN_CHILD(Signature,xmlsignature,XMLSIG_NS,false);
1100                 PROC_TYPED_CHILD(Extensions,SAML20MD_NS,false);
1101                 PROC_TYPED_CHILDREN(KeyDescriptor,SAML20MD_NS,false);
1102                 PROC_TYPED_CHILD(Organization,SAML20MD_NS,false);
1103                 PROC_TYPED_CHILDREN(ContactPerson,SAML20MD_NS,false);
1104                 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
1105             }
1106
1107             void processAttribute(const DOMAttr* attribute) {
1108                 PROC_ID_ATTRIB(ID,ID,NULL);
1109                 unmarshallExtensionAttribute(attribute);
1110             }
1111         };
1112
1113         class SAML_DLLLOCAL RoleDescriptorTypeImpl : public virtual RoleDescriptorType, public RoleDescriptorImpl
1114         {
1115         public:
1116             virtual ~RoleDescriptorTypeImpl() {}
1117
1118             RoleDescriptorTypeImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
1119                 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
1120             }
1121
1122             RoleDescriptorTypeImpl(const RoleDescriptorTypeImpl& src) : AbstractXMLObject(src), RoleDescriptorImpl(src) {
1123                 VectorOf(XMLObject) v=getUnknownXMLObjects();
1124                 for (vector<XMLObject*>::const_iterator i=src.m_UnknownXMLObjects.begin(); i!=src.m_UnknownXMLObjects.end(); ++i)
1125                     v.push_back((*i)->clone());
1126             }
1127
1128             IMPL_XMLOBJECT_CLONE(RoleDescriptorType);
1129             RoleDescriptor* cloneRoleDescriptor() const {
1130                 return new RoleDescriptorTypeImpl(*this);
1131             }
1132
1133             IMPL_XMLOBJECT_CHILDREN(UnknownXMLObject,m_children.end());
1134
1135         protected:
1136             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
1137                 getUnknownXMLObjects().push_back(childXMLObject);
1138             }
1139         };
1140
1141         class SAML_DLLLOCAL SSODescriptorTypeImpl : public virtual SSODescriptorType, public RoleDescriptorImpl
1142         {
1143             void init() {
1144                 m_children.push_back(NULL);
1145                 m_children.push_back(NULL);
1146                 m_children.push_back(NULL);
1147                 m_children.push_back(NULL);
1148                 m_pos_ArtifactResolutionService=m_pos_ContactPerson;
1149                 ++m_pos_ArtifactResolutionService;
1150                 m_pos_SingleLogoutService=m_pos_ArtifactResolutionService;
1151                 ++m_pos_SingleLogoutService;
1152                 m_pos_ManageNameIDService=m_pos_SingleLogoutService;
1153                 ++m_pos_ManageNameIDService;
1154                 m_pos_NameIDFormat=m_pos_ManageNameIDService;
1155                 ++m_pos_NameIDFormat;
1156             }
1157
1158         protected:
1159             list<XMLObject*>::iterator m_pos_ArtifactResolutionService;
1160             list<XMLObject*>::iterator m_pos_SingleLogoutService;
1161             list<XMLObject*>::iterator m_pos_ManageNameIDService;
1162             list<XMLObject*>::iterator m_pos_NameIDFormat;
1163
1164             SSODescriptorTypeImpl() {
1165                 init();
1166             }
1167
1168         public:
1169             virtual ~SSODescriptorTypeImpl() {}
1170
1171             SSODescriptorTypeImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
1172                 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
1173                 init();
1174             }
1175
1176             SSODescriptorTypeImpl(const SSODescriptorTypeImpl& src) : AbstractXMLObject(src), RoleDescriptorImpl(src) {
1177                 init();
1178                 VectorOf(ArtifactResolutionService) v=getArtifactResolutionServices();
1179                 for (vector<ArtifactResolutionService*>::const_iterator i=src.m_ArtifactResolutionServices.begin(); i!=src.m_ArtifactResolutionServices.end(); i++) {
1180                     if (*i) {
1181                         v.push_back((*i)->cloneArtifactResolutionService());
1182                     }
1183                 }
1184                 VectorOf(SingleLogoutService) w=getSingleLogoutServices();
1185                 for (vector<SingleLogoutService*>::const_iterator j=src.m_SingleLogoutServices.begin(); j!=src.m_SingleLogoutServices.end(); j++) {
1186                     if (*j) {
1187                         w.push_back((*j)->cloneSingleLogoutService());
1188                     }
1189                 }
1190                 VectorOf(ManageNameIDService) x=getManageNameIDServices();
1191                 for (vector<ManageNameIDService*>::const_iterator k=src.m_ManageNameIDServices.begin(); k!=src.m_ManageNameIDServices.end(); k++) {
1192                     if (*k) {
1193                         x.push_back((*k)->cloneManageNameIDService());
1194                     }
1195                 }
1196                 VectorOf(NameIDFormat) y=getNameIDFormats();
1197                 for (vector<NameIDFormat*>::const_iterator m=src.m_NameIDFormats.begin(); m!=src.m_NameIDFormats.end(); m++) {
1198                     if (*m) {
1199                         y.push_back((*m)->cloneNameIDFormat());
1200                     }
1201                 }
1202             }
1203
1204             IMPL_TYPED_CHILDREN(ArtifactResolutionService,m_pos_ArtifactResolutionService);
1205             IMPL_TYPED_CHILDREN(SingleLogoutService,m_pos_SingleLogoutService);
1206             IMPL_TYPED_CHILDREN(ManageNameIDService,m_pos_ManageNameIDService);
1207             IMPL_TYPED_CHILDREN(NameIDFormat,m_pos_NameIDFormat);
1208
1209         protected:
1210             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
1211                 PROC_TYPED_CHILDREN(ArtifactResolutionService,SAML20MD_NS,false);
1212                 PROC_TYPED_CHILDREN(SingleLogoutService,SAML20MD_NS,false);
1213                 PROC_TYPED_CHILDREN(ManageNameIDService,SAML20MD_NS,false);
1214                 PROC_TYPED_CHILDREN(NameIDFormat,SAML20MD_NS,false);
1215                 RoleDescriptorImpl::processChildElement(childXMLObject,root);
1216             }
1217         };
1218
1219         class SAML_DLLLOCAL IDPSSODescriptorImpl : public virtual IDPSSODescriptor, public SSODescriptorTypeImpl
1220         {
1221             list<XMLObject*>::iterator m_pos_SingleSignOnService;
1222             list<XMLObject*>::iterator m_pos_NameIDMappingService;
1223             list<XMLObject*>::iterator m_pos_AssertionIDRequestService;
1224             list<XMLObject*>::iterator m_pos_AttributeProfile;
1225
1226             void init() {
1227                 m_WantAuthnRequestsSigned=XML_BOOL_NULL;
1228                 m_children.push_back(NULL);
1229                 m_children.push_back(NULL);
1230                 m_children.push_back(NULL);
1231                 m_children.push_back(NULL);
1232                 m_pos_SingleSignOnService=m_pos_NameIDFormat;
1233                 ++m_pos_SingleSignOnService;
1234                 m_pos_NameIDMappingService=m_pos_SingleSignOnService;
1235                 ++m_pos_NameIDMappingService;
1236                 m_pos_AssertionIDRequestService=m_pos_NameIDMappingService;
1237                 ++m_pos_AssertionIDRequestService;
1238                 m_pos_AttributeProfile=m_pos_AssertionIDRequestService;
1239                 ++m_pos_AttributeProfile;
1240             }
1241
1242         public:
1243             virtual ~IDPSSODescriptorImpl() {}
1244
1245             IDPSSODescriptorImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
1246                 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
1247                 init();
1248             }
1249
1250             IDPSSODescriptorImpl(const IDPSSODescriptorImpl& src) : AbstractXMLObject(src), SSODescriptorTypeImpl(src) {
1251                 init();
1252                 WantAuthnRequestsSigned(src.m_WantAuthnRequestsSigned);
1253                 VectorOf(SingleSignOnService) v=getSingleSignOnServices();
1254                 for (vector<SingleSignOnService*>::const_iterator i=src.m_SingleSignOnServices.begin(); i!=src.m_SingleSignOnServices.end(); i++) {
1255                     if (*i) {
1256                         v.push_back((*i)->cloneSingleSignOnService());
1257                     }
1258                 }
1259                 VectorOf(NameIDMappingService) w=getNameIDMappingServices();
1260                 for (vector<NameIDMappingService*>::const_iterator j=src.m_NameIDMappingServices.begin(); j!=src.m_NameIDMappingServices.end(); j++) {
1261                     if (*j) {
1262                         w.push_back((*j)->cloneNameIDMappingService());
1263                     }
1264                 }
1265                 VectorOf(AssertionIDRequestService) x=getAssertionIDRequestServices();
1266                 for (vector<AssertionIDRequestService*>::const_iterator k=src.m_AssertionIDRequestServices.begin(); k!=src.m_AssertionIDRequestServices.end(); k++) {
1267                     if (*k) {
1268                         x.push_back((*k)->cloneAssertionIDRequestService());
1269                     }
1270                 }
1271                 VectorOf(AttributeProfile) y=getAttributeProfiles();
1272                 for (vector<AttributeProfile*>::const_iterator m=src.m_AttributeProfiles.begin(); m!=src.m_AttributeProfiles.end(); m++) {
1273                     if (*m) {
1274                         y.push_back((*m)->cloneAttributeProfile());
1275                     }
1276                 }
1277                 VectorOf(Attribute) z=getAttributes();
1278                 for (vector<Attribute*>::const_iterator n=src.m_Attributes.begin(); n!=src.m_Attributes.end(); n++) {
1279                     if (*n) {
1280                         z.push_back((*n)->cloneAttribute());
1281                     }
1282                 }
1283             }
1284
1285             IMPL_XMLOBJECT_CLONE(IDPSSODescriptor);
1286             SSODescriptorType* cloneSSODescriptorType() const {
1287                 return new IDPSSODescriptorImpl(*this);
1288             }
1289             RoleDescriptor* cloneRoleDescriptor() const {
1290                 return new IDPSSODescriptorImpl(*this);
1291             }
1292
1293             IMPL_BOOLEAN_ATTRIB(WantAuthnRequestsSigned);
1294             IMPL_TYPED_CHILDREN(SingleSignOnService,m_pos_SingleSignOnService);
1295             IMPL_TYPED_CHILDREN(NameIDMappingService,m_pos_NameIDMappingService);
1296             IMPL_TYPED_CHILDREN(AssertionIDRequestService,m_pos_AssertionIDRequestService);
1297             IMPL_TYPED_CHILDREN(AttributeProfile,m_pos_AttributeProfile);
1298             IMPL_TYPED_FOREIGN_CHILDREN(Attribute,saml2,m_children.end());
1299
1300             void setAttribute(const xmltooling::QName& qualifiedName, const XMLCh* value, bool ID=false) {
1301                 if (!qualifiedName.hasNamespaceURI()) {
1302                     if (XMLString::equals(qualifiedName.getLocalPart(),WANTAUTHNREQUESTSSIGNED_ATTRIB_NAME)) {
1303                         setWantAuthnRequestsSigned(value);
1304                         return;
1305                     }
1306                 }
1307                 RoleDescriptorImpl::setAttribute(qualifiedName, value, ID);
1308             }
1309
1310         protected:
1311             void marshallAttributes(DOMElement* domElement) const {
1312                 MARSHALL_BOOLEAN_ATTRIB(WantAuthnRequestsSigned,WANTAUTHNREQUESTSSIGNED,NULL);
1313                 RoleDescriptorImpl::marshallAttributes(domElement);
1314             }
1315
1316             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
1317                 PROC_TYPED_CHILDREN(SingleSignOnService,SAML20MD_NS,false);
1318                 PROC_TYPED_CHILDREN(NameIDMappingService,SAML20MD_NS,false);
1319                 PROC_TYPED_CHILDREN(AssertionIDRequestService,SAML20MD_NS,false);
1320                 PROC_TYPED_CHILDREN(AttributeProfile,SAML20MD_NS,false);
1321                 PROC_TYPED_FOREIGN_CHILDREN(Attribute,saml2,SAML20_NS,false);
1322                 SSODescriptorTypeImpl::processChildElement(childXMLObject,root);
1323             }
1324         };
1325
1326         class SAML_DLLLOCAL RequestedAttributeImpl : public virtual RequestedAttribute,
1327             public AbstractComplexElement,
1328             public AbstractAttributeExtensibleXMLObject,
1329             public AbstractDOMCachingXMLObject,
1330             public AbstractXMLObjectMarshaller,
1331             public AbstractXMLObjectUnmarshaller
1332         {
1333             void init() {
1334                 m_Name=m_NameFormat=m_FriendlyName=NULL;
1335                 m_isRequired=XML_BOOL_NULL;
1336             }
1337         public:
1338             virtual ~RequestedAttributeImpl() {
1339                 XMLString::release(&m_Name);
1340                 XMLString::release(&m_NameFormat);
1341                 XMLString::release(&m_FriendlyName);
1342             }
1343
1344             RequestedAttributeImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
1345                 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
1346                 init();
1347             }
1348
1349             RequestedAttributeImpl(const RequestedAttributeImpl& src)
1350                     : AbstractXMLObject(src), AbstractComplexElement(src),
1351                         AbstractAttributeExtensibleXMLObject(src), AbstractDOMCachingXMLObject(src) {
1352                 init();
1353                 setName(src.getName());
1354                 setNameFormat(src.getNameFormat());
1355                 setFriendlyName(src.getFriendlyName());
1356                 isRequired(src.m_isRequired);
1357                 VectorOf(XMLObject) v=getAttributeValues();
1358                 for (vector<XMLObject*>::const_iterator i=src.m_AttributeValues.begin(); i!=src.m_AttributeValues.end(); i++) {
1359                     if (*i) {
1360                         v.push_back((*i)->clone());
1361                     }
1362                 }
1363             }
1364
1365             IMPL_XMLOBJECT_CLONE(RequestedAttribute);
1366             Attribute* cloneAttribute() const {
1367                 return new RequestedAttributeImpl(*this);
1368             }
1369
1370             IMPL_STRING_ATTRIB(Name);
1371             IMPL_STRING_ATTRIB(NameFormat);
1372             IMPL_STRING_ATTRIB(FriendlyName);
1373             IMPL_BOOLEAN_ATTRIB(isRequired);
1374             IMPL_XMLOBJECT_CHILDREN(AttributeValue,m_children.end());
1375
1376             void setAttribute(const xmltooling::QName& qualifiedName, const XMLCh* value, bool ID=false) {
1377                 if (!qualifiedName.hasNamespaceURI()) {
1378                     if (XMLString::equals(qualifiedName.getLocalPart(),NAME_ATTRIB_NAME)) {
1379                         setName(value);
1380                         return;
1381                     }
1382                     else if (XMLString::equals(qualifiedName.getLocalPart(),NAMEFORMAT_ATTRIB_NAME)) {
1383                         setNameFormat(value);
1384                         return;
1385                     }
1386                     else if (XMLString::equals(qualifiedName.getLocalPart(),FRIENDLYNAME_ATTRIB_NAME)) {
1387                         setFriendlyName(value);
1388                         return;
1389                     }
1390                     else if (XMLString::equals(qualifiedName.getLocalPart(),ISREQUIRED_ATTRIB_NAME)) {
1391                         setisRequired(value);
1392                         return;
1393                     }
1394                 }
1395                 AbstractAttributeExtensibleXMLObject::setAttribute(qualifiedName, value, ID);
1396             }
1397
1398         protected:
1399             void marshallAttributes(DOMElement* domElement) const {
1400                 MARSHALL_STRING_ATTRIB(Name,NAME,NULL);
1401                 MARSHALL_STRING_ATTRIB(NameFormat,NAMEFORMAT,NULL);
1402                 MARSHALL_STRING_ATTRIB(FriendlyName,FRIENDLYNAME,NULL);
1403                 MARSHALL_BOOLEAN_ATTRIB(isRequired,ISREQUIRED,NULL);
1404                 marshallExtensionAttributes(domElement);
1405             }
1406
1407             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
1408                 getAttributeValues().push_back(childXMLObject);
1409             }
1410
1411             void processAttribute(const DOMAttr* attribute) {
1412                 unmarshallExtensionAttribute(attribute);
1413             }
1414         };
1415
1416         class SAML_DLLLOCAL AttributeConsumingServiceImpl : public virtual AttributeConsumingService,
1417             public AbstractComplexElement,
1418             public AbstractDOMCachingXMLObject,
1419             public AbstractXMLObjectMarshaller,
1420             public AbstractXMLObjectUnmarshaller
1421         {
1422             list<XMLObject*>::iterator m_pos_ServiceDescription;
1423             list<XMLObject*>::iterator m_pos_RequestedAttribute;
1424
1425                 void init() {
1426                 m_Index=NULL;
1427                 m_isDefault=XML_BOOL_NULL;
1428                 m_children.push_back(NULL);
1429                 m_children.push_back(NULL);
1430                 m_pos_ServiceDescription=m_children.begin();
1431                 m_pos_RequestedAttribute=m_pos_ServiceDescription;
1432                 ++m_pos_RequestedAttribute;
1433             }
1434
1435         public:
1436             virtual ~AttributeConsumingServiceImpl() {
1437                 XMLString::release(&m_Index);
1438             }
1439
1440             AttributeConsumingServiceImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
1441                 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
1442                 init();
1443             }
1444
1445             AttributeConsumingServiceImpl(const AttributeConsumingServiceImpl& src)
1446                     : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
1447                 init();
1448                 setIndex(src.m_Index);
1449                 isDefault(src.m_isDefault);
1450                 VectorOf(ServiceName) v=getServiceNames();
1451                 for (vector<ServiceName*>::const_iterator i=src.m_ServiceNames.begin(); i!=src.m_ServiceNames.end(); i++) {
1452                     if (*i) {
1453                         v.push_back((*i)->cloneServiceName());
1454                     }
1455                 }
1456                 VectorOf(ServiceDescription) w=getServiceDescriptions();
1457                 for (vector<ServiceDescription*>::const_iterator j=src.m_ServiceDescriptions.begin(); j!=src.m_ServiceDescriptions.end(); j++) {
1458                     if (*j) {
1459                         w.push_back((*j)->cloneServiceDescription());
1460                     }
1461                 }
1462                 VectorOf(RequestedAttribute) x=getRequestedAttributes();
1463                 for (vector<RequestedAttribute*>::const_iterator k=src.m_RequestedAttributes.begin(); k!=src.m_RequestedAttributes.end(); k++) {
1464                     if (*k) {
1465                         x.push_back((*k)->cloneRequestedAttribute());
1466                     }
1467                 }
1468             }
1469
1470             IMPL_XMLOBJECT_CLONE(AttributeConsumingService);
1471             IMPL_INTEGER_ATTRIB(Index);
1472             IMPL_BOOLEAN_ATTRIB(isDefault);
1473             IMPL_TYPED_CHILDREN(ServiceName,m_pos_ServiceDescription);
1474             IMPL_TYPED_CHILDREN(ServiceDescription,m_pos_RequestedAttribute);
1475             IMPL_TYPED_CHILDREN(RequestedAttribute,m_children.end());
1476
1477         protected:
1478             void marshallAttributes(DOMElement* domElement) const {
1479                 MARSHALL_INTEGER_ATTRIB(Index,INDEX,NULL);
1480                 MARSHALL_BOOLEAN_ATTRIB(isDefault,ISDEFAULT,NULL);
1481             }
1482
1483             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
1484                 PROC_TYPED_CHILDREN(ServiceName,SAML20MD_NS,false);
1485                 PROC_TYPED_CHILDREN(ServiceDescription,SAML20MD_NS,false);
1486                 PROC_TYPED_CHILDREN(RequestedAttribute,SAML20MD_NS,false);
1487                 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
1488             }
1489
1490             void processAttribute(const DOMAttr* attribute) {
1491                 PROC_INTEGER_ATTRIB(Index,INDEX,NULL);
1492                 PROC_BOOLEAN_ATTRIB(isDefault,ISDEFAULT,NULL);
1493                 AbstractXMLObjectUnmarshaller::processAttribute(attribute);
1494             }
1495         };
1496
1497         class SAML_DLLLOCAL SPSSODescriptorImpl : public virtual SPSSODescriptor, public SSODescriptorTypeImpl
1498         {
1499             list<XMLObject*>::iterator m_pos_AssertionConsumerService;
1500
1501             void init() {
1502                 m_AuthnRequestsSigned=XML_BOOL_NULL;
1503                 m_WantAssertionsSigned=XML_BOOL_NULL;
1504                 m_children.push_back(NULL);
1505                 m_pos_AssertionConsumerService=m_pos_NameIDFormat;
1506                 ++m_pos_AssertionConsumerService;
1507             }
1508
1509         public:
1510             virtual ~SPSSODescriptorImpl() {}
1511
1512             SPSSODescriptorImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
1513                 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
1514                 init();
1515             }
1516
1517             SPSSODescriptorImpl(const SPSSODescriptorImpl& src) : AbstractXMLObject(src), SSODescriptorTypeImpl(src) {
1518                 init();
1519                 AuthnRequestsSigned(src.m_AuthnRequestsSigned);
1520                 WantAssertionsSigned(src.m_WantAssertionsSigned);
1521                 VectorOf(AssertionConsumerService) v=getAssertionConsumerServices();
1522                 for (vector<AssertionConsumerService*>::const_iterator i=src.m_AssertionConsumerServices.begin(); i!=src.m_AssertionConsumerServices.end(); i++) {
1523                     if (*i) {
1524                         v.push_back((*i)->cloneAssertionConsumerService());
1525                     }
1526                 }
1527                 VectorOf(AttributeConsumingService) w=getAttributeConsumingServices();
1528                 for (vector<AttributeConsumingService*>::const_iterator j=src.m_AttributeConsumingServices.begin(); j!=src.m_AttributeConsumingServices.end(); j++) {
1529                     if (*j) {
1530                         w.push_back((*j)->cloneAttributeConsumingService());
1531                     }
1532                 }
1533             }
1534
1535             IMPL_XMLOBJECT_CLONE(SPSSODescriptor);
1536             SSODescriptorType* cloneSSODescriptorType() const {
1537                 return cloneSPSSODescriptor();
1538             }
1539             RoleDescriptor* cloneRoleDescriptor() const {
1540                 return cloneSPSSODescriptor();
1541             }
1542
1543             IMPL_BOOLEAN_ATTRIB(AuthnRequestsSigned);
1544             IMPL_BOOLEAN_ATTRIB(WantAssertionsSigned);
1545             IMPL_TYPED_CHILDREN(AssertionConsumerService,m_pos_AssertionConsumerService);
1546             IMPL_TYPED_CHILDREN(AttributeConsumingService,m_children.end());
1547
1548             void setAttribute(const xmltooling::QName& qualifiedName, const XMLCh* value, bool ID=false) {
1549                 if (!qualifiedName.hasNamespaceURI()) {
1550                     if (XMLString::equals(qualifiedName.getLocalPart(),AUTHNREQUESTSSIGNED_ATTRIB_NAME)) {
1551                         setAuthnRequestsSigned(value);
1552                         return;
1553                     }
1554                     else if (XMLString::equals(qualifiedName.getLocalPart(),WANTASSERTIONSSIGNED_ATTRIB_NAME)) {
1555                         setWantAssertionsSigned(value);
1556                         return;
1557                     }
1558                 }
1559                 RoleDescriptorImpl::setAttribute(qualifiedName, value, ID);
1560             }
1561
1562         protected:
1563             void marshallAttributes(DOMElement* domElement) const {
1564                 MARSHALL_BOOLEAN_ATTRIB(AuthnRequestsSigned,AUTHNREQUESTSSIGNED,NULL);
1565                 MARSHALL_BOOLEAN_ATTRIB(WantAssertionsSigned,WANTASSERTIONSSIGNED,NULL);
1566                 RoleDescriptorImpl::marshallAttributes(domElement);
1567             }
1568
1569             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
1570                 PROC_TYPED_CHILDREN(AssertionConsumerService,SAML20MD_NS,false);
1571                 PROC_TYPED_CHILDREN(AttributeConsumingService,SAML20MD_NS,false);
1572                 SSODescriptorTypeImpl::processChildElement(childXMLObject,root);
1573             }
1574         };
1575
1576         class SAML_DLLLOCAL AuthnAuthorityDescriptorImpl : public virtual AuthnAuthorityDescriptor, public RoleDescriptorImpl
1577         {
1578             list<XMLObject*>::iterator m_pos_AuthnQueryService;
1579             list<XMLObject*>::iterator m_pos_AssertionIDRequestService;
1580
1581             void init() {
1582                 m_children.push_back(NULL);
1583                 m_children.push_back(NULL);
1584                 m_pos_AuthnQueryService=m_pos_ContactPerson;
1585                 ++m_pos_AuthnQueryService;
1586                 m_pos_AssertionIDRequestService=m_pos_AuthnQueryService;
1587                 ++m_pos_AssertionIDRequestService;
1588             }
1589
1590         public:
1591             virtual ~AuthnAuthorityDescriptorImpl() {}
1592
1593             AuthnAuthorityDescriptorImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
1594                 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
1595                 init();
1596             }
1597
1598             AuthnAuthorityDescriptorImpl(const AuthnAuthorityDescriptorImpl& src) : AbstractXMLObject(src), RoleDescriptorImpl(src) {
1599                 init();
1600                 VectorOf(AuthnQueryService) v=getAuthnQueryServices();
1601                 for (vector<AuthnQueryService*>::const_iterator i=src.m_AuthnQueryServices.begin(); i!=src.m_AuthnQueryServices.end(); i++) {
1602                     if (*i) {
1603                         v.push_back((*i)->cloneAuthnQueryService());
1604                     }
1605                 }
1606                 VectorOf(AssertionIDRequestService) w=getAssertionIDRequestServices();
1607                 for (vector<AssertionIDRequestService*>::const_iterator j=src.m_AssertionIDRequestServices.begin(); j!=src.m_AssertionIDRequestServices.end(); j++) {
1608                     if (*j) {
1609                         w.push_back((*j)->cloneAssertionIDRequestService());
1610                     }
1611                 }
1612                 VectorOf(NameIDFormat) x=getNameIDFormats();
1613                 for (vector<NameIDFormat*>::const_iterator k=src.m_NameIDFormats.begin(); k!=src.m_NameIDFormats.end(); k++) {
1614                     if (*k) {
1615                         x.push_back((*k)->cloneNameIDFormat());
1616                     }
1617                 }
1618             }
1619
1620             IMPL_XMLOBJECT_CLONE(AuthnAuthorityDescriptor);
1621             RoleDescriptor* cloneRoleDescriptor() const {
1622                 return cloneAuthnAuthorityDescriptor();
1623             }
1624
1625             IMPL_TYPED_CHILDREN(AuthnQueryService,m_pos_AuthnQueryService);
1626             IMPL_TYPED_CHILDREN(AssertionIDRequestService,m_pos_AssertionIDRequestService);
1627             IMPL_TYPED_CHILDREN(NameIDFormat,m_children.end());
1628
1629         protected:
1630             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
1631                 PROC_TYPED_CHILDREN(AuthnQueryService,SAML20MD_NS,false);
1632                 PROC_TYPED_CHILDREN(AssertionIDRequestService,SAML20MD_NS,false);
1633                 PROC_TYPED_CHILDREN(NameIDFormat,SAML20MD_NS,false);
1634                 RoleDescriptorImpl::processChildElement(childXMLObject,root);
1635             }
1636         };
1637
1638         class SAML_DLLLOCAL PDPDescriptorImpl : public virtual PDPDescriptor, public RoleDescriptorImpl
1639         {
1640             list<XMLObject*>::iterator m_pos_AuthzService;
1641             list<XMLObject*>::iterator m_pos_AssertionIDRequestService;
1642
1643             void init() {
1644                 m_children.push_back(NULL);
1645                 m_children.push_back(NULL);
1646                 m_pos_AuthzService=m_pos_ContactPerson;
1647                 ++m_pos_AuthzService;
1648                 m_pos_AssertionIDRequestService=m_pos_AuthzService;
1649                 ++m_pos_AssertionIDRequestService;
1650             }
1651
1652         public:
1653             virtual ~PDPDescriptorImpl() {}
1654
1655             PDPDescriptorImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
1656                 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
1657                 init();
1658             }
1659
1660             PDPDescriptorImpl(const PDPDescriptorImpl& src) : AbstractXMLObject(src), RoleDescriptorImpl(src) {
1661                 init();
1662                 VectorOf(AuthzService) v=getAuthzServices();
1663                 for (vector<AuthzService*>::const_iterator i=src.m_AuthzServices.begin(); i!=src.m_AuthzServices.end(); i++) {
1664                     if (*i) {
1665                         v.push_back((*i)->cloneAuthzService());
1666                     }
1667                 }
1668                 VectorOf(AssertionIDRequestService) w=getAssertionIDRequestServices();
1669                 for (vector<AssertionIDRequestService*>::const_iterator j=src.m_AssertionIDRequestServices.begin(); j!=src.m_AssertionIDRequestServices.end(); j++) {
1670                     if (*j) {
1671                         w.push_back((*j)->cloneAssertionIDRequestService());
1672                     }
1673                 }
1674                 VectorOf(NameIDFormat) x=getNameIDFormats();
1675                 for (vector<NameIDFormat*>::const_iterator k=src.m_NameIDFormats.begin(); k!=src.m_NameIDFormats.end(); k++) {
1676                     if (*k) {
1677                         x.push_back((*k)->cloneNameIDFormat());
1678                     }
1679                 }
1680             }
1681
1682             IMPL_XMLOBJECT_CLONE(PDPDescriptor);
1683             RoleDescriptor* cloneRoleDescriptor() const {
1684                 return clonePDPDescriptor();
1685             }
1686
1687             IMPL_TYPED_CHILDREN(AuthzService,m_pos_AuthzService);
1688             IMPL_TYPED_CHILDREN(AssertionIDRequestService,m_pos_AssertionIDRequestService);
1689             IMPL_TYPED_CHILDREN(NameIDFormat,m_children.end());
1690
1691         protected:
1692             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
1693                 PROC_TYPED_CHILDREN(AuthzService,SAML20MD_NS,false);
1694                 PROC_TYPED_CHILDREN(AssertionIDRequestService,SAML20MD_NS,false);
1695                 PROC_TYPED_CHILDREN(NameIDFormat,SAML20MD_NS,false);
1696                 RoleDescriptorImpl::processChildElement(childXMLObject,root);
1697             }
1698         };
1699
1700         class SAML_DLLLOCAL AttributeAuthorityDescriptorImpl : public virtual AttributeAuthorityDescriptor, public RoleDescriptorImpl
1701         {
1702             list<XMLObject*>::iterator m_pos_AttributeService;
1703             list<XMLObject*>::iterator m_pos_AssertionIDRequestService;
1704             list<XMLObject*>::iterator m_pos_NameIDFormat;
1705             list<XMLObject*>::iterator m_pos_AttributeProfile;
1706
1707             void init() {
1708                 m_children.push_back(NULL);
1709                 m_children.push_back(NULL);
1710                 m_children.push_back(NULL);
1711                 m_children.push_back(NULL);
1712                 m_pos_AttributeService=m_pos_ContactPerson;
1713                 ++m_pos_AttributeService;
1714                 m_pos_AssertionIDRequestService=m_pos_AttributeService;
1715                 ++m_pos_AssertionIDRequestService;
1716                 m_pos_NameIDFormat=m_pos_AssertionIDRequestService;
1717                 ++m_pos_NameIDFormat;
1718                 m_pos_AttributeProfile=m_pos_NameIDFormat;
1719                 ++m_pos_AttributeProfile;
1720             }
1721
1722         public:
1723             virtual ~AttributeAuthorityDescriptorImpl() {}
1724
1725             AttributeAuthorityDescriptorImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
1726                 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
1727                 init();
1728             }
1729
1730             AttributeAuthorityDescriptorImpl(const AttributeAuthorityDescriptorImpl& src) : AbstractXMLObject(src), RoleDescriptorImpl(src) {
1731                 init();
1732                 VectorOf(AttributeService) v=getAttributeServices();
1733                 for (vector<AttributeService*>::const_iterator i=src.m_AttributeServices.begin(); i!=src.m_AttributeServices.end(); i++) {
1734                     if (*i) {
1735                         v.push_back((*i)->cloneAttributeService());
1736                     }
1737                 }
1738                 VectorOf(AssertionIDRequestService) w=getAssertionIDRequestServices();
1739                 for (vector<AssertionIDRequestService*>::const_iterator j=src.m_AssertionIDRequestServices.begin(); j!=src.m_AssertionIDRequestServices.end(); j++) {
1740                     if (*j) {
1741                         w.push_back((*j)->cloneAssertionIDRequestService());
1742                     }
1743                 }
1744                 VectorOf(NameIDFormat) x=getNameIDFormats();
1745                 for (vector<NameIDFormat*>::const_iterator k=src.m_NameIDFormats.begin(); k!=src.m_NameIDFormats.end(); k++) {
1746                     if (*k) {
1747                         x.push_back((*k)->cloneNameIDFormat());
1748                     }
1749                 }
1750                 VectorOf(AttributeProfile) y=getAttributeProfiles();
1751                 for (vector<AttributeProfile*>::const_iterator m=src.m_AttributeProfiles.begin(); m!=src.m_AttributeProfiles.end(); m++) {
1752                     if (*m) {
1753                         y.push_back((*m)->cloneAttributeProfile());
1754                     }
1755                 }
1756                 VectorOf(Attribute) z=getAttributes();
1757                 for (vector<Attribute*>::const_iterator n=src.m_Attributes.begin(); n!=src.m_Attributes.end(); n++) {
1758                     if (*n) {
1759                         z.push_back((*n)->cloneAttribute());
1760                     }
1761                 }
1762             }
1763
1764             IMPL_XMLOBJECT_CLONE(AttributeAuthorityDescriptor);
1765             RoleDescriptor* cloneRoleDescriptor() const {
1766                 return cloneAttributeAuthorityDescriptor();
1767             }
1768
1769             IMPL_TYPED_CHILDREN(AttributeService,m_pos_AttributeService);
1770             IMPL_TYPED_CHILDREN(AssertionIDRequestService,m_pos_AssertionIDRequestService);
1771             IMPL_TYPED_CHILDREN(NameIDFormat,m_pos_NameIDFormat);
1772             IMPL_TYPED_CHILDREN(AttributeProfile,m_pos_AttributeProfile);
1773             IMPL_TYPED_FOREIGN_CHILDREN(Attribute,saml2,m_children.end());
1774
1775         protected:
1776             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
1777                 PROC_TYPED_CHILDREN(AttributeService,SAML20MD_NS,false);
1778                 PROC_TYPED_CHILDREN(AssertionIDRequestService,SAML20MD_NS,false);
1779                 PROC_TYPED_CHILDREN(NameIDFormat,SAML20MD_NS,false);
1780                 PROC_TYPED_CHILDREN(AttributeProfile,SAML20MD_NS,false);
1781                 PROC_TYPED_FOREIGN_CHILDREN(Attribute,saml2,SAML20_NS,false);
1782                 RoleDescriptorImpl::processChildElement(childXMLObject,root);
1783             }
1784         };
1785
1786         class SAML_DLLLOCAL QueryDescriptorTypeImpl : public virtual QueryDescriptorType, public RoleDescriptorImpl
1787         {
1788             void init() {
1789                 m_WantAssertionsSigned=XML_BOOL_NULL;
1790                 m_children.push_back(NULL);
1791                 m_pos_NameIDFormat=m_pos_ContactPerson;
1792                 ++m_pos_NameIDFormat;
1793             }
1794
1795         protected:
1796             list<XMLObject*>::iterator m_pos_NameIDFormat;
1797
1798             QueryDescriptorTypeImpl() {
1799                 init();
1800             }
1801
1802         public:
1803             virtual ~QueryDescriptorTypeImpl() {}
1804
1805             QueryDescriptorTypeImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
1806                 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
1807                 init();
1808             }
1809
1810             QueryDescriptorTypeImpl(const QueryDescriptorTypeImpl& src) : AbstractXMLObject(src), RoleDescriptorImpl(src) {
1811                 init();
1812                 WantAssertionsSigned(src.m_WantAssertionsSigned);
1813                 VectorOf(NameIDFormat) y=getNameIDFormats();
1814                 for (vector<NameIDFormat*>::const_iterator m=src.m_NameIDFormats.begin(); m!=src.m_NameIDFormats.end(); m++) {
1815                     if (*m) {
1816                         y.push_back((*m)->cloneNameIDFormat());
1817                     }
1818                 }
1819             }
1820
1821             IMPL_BOOLEAN_ATTRIB(WantAssertionsSigned);
1822             IMPL_TYPED_CHILDREN(NameIDFormat,m_pos_NameIDFormat);
1823
1824             void setAttribute(const xmltooling::QName& qualifiedName, const XMLCh* value, bool ID=false) {
1825                 if (!qualifiedName.hasNamespaceURI()) {
1826                     if (XMLString::equals(qualifiedName.getLocalPart(),WANTASSERTIONSSIGNED_ATTRIB_NAME)) {
1827                         setWantAssertionsSigned(value);
1828                         return;
1829                     }
1830                 }
1831                 RoleDescriptorImpl::setAttribute(qualifiedName, value, ID);
1832             }
1833
1834         protected:
1835             void marshallAttributes(DOMElement* domElement) const {
1836                 MARSHALL_BOOLEAN_ATTRIB(WantAssertionsSigned,WANTASSERTIONSSIGNED,NULL);
1837                 RoleDescriptorImpl::marshallAttributes(domElement);
1838             }
1839
1840             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
1841                 PROC_TYPED_CHILDREN(NameIDFormat,SAML20MD_NS,false);
1842                 RoleDescriptorImpl::processChildElement(childXMLObject,root);
1843             }
1844         };
1845
1846         class SAML_DLLLOCAL AuthnQueryDescriptorTypeImpl : public virtual AuthnQueryDescriptorType, public QueryDescriptorTypeImpl
1847         {
1848         public:
1849             virtual ~AuthnQueryDescriptorTypeImpl() {}
1850
1851             AuthnQueryDescriptorTypeImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
1852                 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {}
1853
1854             AuthnQueryDescriptorTypeImpl(const AuthnQueryDescriptorTypeImpl& src) : AbstractXMLObject(src), QueryDescriptorTypeImpl(src) {}
1855
1856             IMPL_XMLOBJECT_CLONE(AuthnQueryDescriptorType);
1857             QueryDescriptorType* cloneQueryDescriptorType() const {
1858                 return new AuthnQueryDescriptorTypeImpl(*this);
1859             }
1860             RoleDescriptor* cloneRoleDescriptor() const {
1861                 return new AuthnQueryDescriptorTypeImpl(*this);
1862             }
1863         };
1864
1865         class SAML_DLLLOCAL AttributeQueryDescriptorTypeImpl : public virtual AttributeQueryDescriptorType, public QueryDescriptorTypeImpl
1866         {
1867         public:
1868             virtual ~AttributeQueryDescriptorTypeImpl() {}
1869
1870             AttributeQueryDescriptorTypeImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
1871                 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {}
1872
1873             AttributeQueryDescriptorTypeImpl(const AttributeQueryDescriptorTypeImpl& src)
1874                     : AbstractXMLObject(src), QueryDescriptorTypeImpl(src) {
1875                 VectorOf(AttributeConsumingService) w=getAttributeConsumingServices();
1876                 for (vector<AttributeConsumingService*>::const_iterator j=src.m_AttributeConsumingServices.begin(); j!=src.m_AttributeConsumingServices.end(); j++) {
1877                     if (*j) {
1878                         w.push_back((*j)->cloneAttributeConsumingService());
1879                     }
1880                 }
1881             }
1882
1883             IMPL_XMLOBJECT_CLONE(AttributeQueryDescriptorType);
1884             QueryDescriptorType* cloneQueryDescriptorType() const {
1885                 return new AttributeQueryDescriptorTypeImpl(*this);
1886             }
1887             RoleDescriptor* cloneRoleDescriptor() const {
1888                 return new AttributeQueryDescriptorTypeImpl(*this);
1889             }
1890
1891             IMPL_TYPED_CHILDREN(AttributeConsumingService,m_children.end());
1892
1893         protected:
1894             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
1895                 PROC_TYPED_CHILDREN(AttributeConsumingService,SAML20MD_NS,false);
1896                 QueryDescriptorTypeImpl::processChildElement(childXMLObject,root);
1897             }
1898         };
1899
1900         class SAML_DLLLOCAL AuthzDecisionQueryDescriptorTypeImpl : public virtual AuthzDecisionQueryDescriptorType, public QueryDescriptorTypeImpl
1901         {
1902         public:
1903             virtual ~AuthzDecisionQueryDescriptorTypeImpl() {}
1904
1905             AuthzDecisionQueryDescriptorTypeImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
1906                 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {}
1907
1908             AuthzDecisionQueryDescriptorTypeImpl(const AuthzDecisionQueryDescriptorTypeImpl& src)
1909                     : AbstractXMLObject(src), QueryDescriptorTypeImpl(src) {
1910                 VectorOf(ActionNamespace) w=getActionNamespaces();
1911                 for (vector<ActionNamespace*>::const_iterator j=src.m_ActionNamespaces.begin(); j!=src.m_ActionNamespaces.end(); j++) {
1912                     if (*j) {
1913                         w.push_back((*j)->cloneActionNamespace());
1914                     }
1915                 }
1916             }
1917
1918             IMPL_XMLOBJECT_CLONE(AuthzDecisionQueryDescriptorType);
1919             QueryDescriptorType* cloneQueryDescriptorType() const {
1920                 return new AuthzDecisionQueryDescriptorTypeImpl(*this);
1921             }
1922             RoleDescriptor* cloneRoleDescriptor() const {
1923                 return new AuthzDecisionQueryDescriptorTypeImpl(*this);
1924             }
1925
1926             IMPL_TYPED_CHILDREN(ActionNamespace,m_children.end());
1927
1928         protected:
1929             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
1930                 PROC_TYPED_CHILDREN(ActionNamespace,samlconstants::SAML20MD_QUERY_EXT_NS,false);
1931                 QueryDescriptorTypeImpl::processChildElement(childXMLObject,root);
1932             }
1933         };
1934
1935         class SAML_DLLLOCAL AffiliationDescriptorImpl : public virtual AffiliationDescriptor,
1936             public virtual SignableObject,
1937             public AbstractComplexElement,
1938             public AbstractAttributeExtensibleXMLObject,
1939             public AbstractDOMCachingXMLObject,
1940             public AbstractXMLObjectMarshaller,
1941             public AbstractXMLObjectUnmarshaller
1942         {
1943             list<XMLObject*>::iterator m_pos_AffiliateMember;
1944
1945             void init() {
1946                 m_ID=m_AffiliationOwnerID=NULL;
1947                 m_ValidUntil=m_CacheDuration=NULL;
1948                 m_children.push_back(NULL);
1949                 m_children.push_back(NULL);
1950                 m_children.push_back(NULL);
1951                 m_Signature=NULL;
1952                 m_Extensions=NULL;
1953                 m_pos_Signature=m_children.begin();
1954                 m_pos_Extensions=m_pos_Signature;
1955                 ++m_pos_Extensions;
1956                 m_pos_AffiliateMember=m_pos_Extensions;
1957                 ++m_pos_AffiliateMember;
1958             }
1959
1960         public:
1961             virtual ~AffiliationDescriptorImpl() {
1962                 XMLString::release(&m_ID);
1963                 XMLString::release(&m_AffiliationOwnerID);
1964                 delete m_ValidUntil;
1965                 delete m_CacheDuration;
1966             }
1967
1968             AffiliationDescriptorImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
1969                 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
1970                 init();
1971             }
1972
1973             AffiliationDescriptorImpl(const AffiliationDescriptorImpl& src)
1974                     : AbstractXMLObject(src), AbstractComplexElement(src),
1975                         AbstractAttributeExtensibleXMLObject(src), AbstractDOMCachingXMLObject(src) {
1976                 init();
1977                 setID(src.getID());
1978                 setAffiliationOwnerID(src.getAffiliationOwnerID());
1979                 setValidUntil(src.getValidUntil());
1980                 setCacheDuration(src.getCacheDuration());
1981                 if (src.getSignature())
1982                     setSignature(src.getSignature()->cloneSignature());
1983                 if (src.getExtensions())
1984                     setExtensions(src.getExtensions()->cloneExtensions());
1985
1986                 VectorOf(KeyDescriptor) v=getKeyDescriptors();
1987                 for (vector<KeyDescriptor*>::const_iterator i=src.m_KeyDescriptors.begin(); i!=src.m_KeyDescriptors.end(); i++) {
1988                     if (*i) {
1989                         v.push_back((*i)->cloneKeyDescriptor());
1990                     }
1991                 }
1992                 VectorOf(AffiliateMember) w=getAffiliateMembers();
1993                 for (vector<AffiliateMember*>::const_iterator j=src.m_AffiliateMembers.begin(); j!=src.m_AffiliateMembers.end(); j++) {
1994                     if (*j) {
1995                         w.push_back((*j)->cloneAffiliateMember());
1996                     }
1997                 }
1998             }
1999
2000             IMPL_XMLOBJECT_CLONE(AffiliationDescriptor);
2001
2002             //IMPL_TYPED_CHILD(Signature);
2003             // Need customized setter.
2004         protected:
2005             Signature* m_Signature;
2006             list<XMLObject*>::iterator m_pos_Signature;
2007         public:
2008             Signature* getSignature() const {
2009                 return m_Signature;
2010             }
2011
2012             void setSignature(Signature* sig) {
2013                 prepareForAssignment(m_Signature,sig);
2014                 *m_pos_Signature=m_Signature=sig;
2015                 // Sync content reference back up.
2016                 if (m_Signature)
2017                     m_Signature->setContentReference(new opensaml::ContentReference(*this));
2018             }
2019
2020             IMPL_ID_ATTRIB(ID);
2021             IMPL_STRING_ATTRIB(AffiliationOwnerID);
2022             IMPL_DATETIME_ATTRIB(ValidUntil,SAMLTIME_MAX);
2023             IMPL_DURATION_ATTRIB(CacheDuration,0);
2024             IMPL_TYPED_CHILD(Extensions);
2025             IMPL_TYPED_CHILDREN(AffiliateMember,m_pos_AffiliateMember);
2026             IMPL_TYPED_CHILDREN(KeyDescriptor,m_children.end());
2027
2028             void setAttribute(const xmltooling::QName& qualifiedName, const XMLCh* value, bool ID=false) {
2029                 if (!qualifiedName.hasNamespaceURI()) {
2030                     if (XMLString::equals(qualifiedName.getLocalPart(),ID_ATTRIB_NAME)) {
2031                         setID(value);
2032                         return;
2033                     }
2034                     else if (XMLString::equals(qualifiedName.getLocalPart(),AFFILIATIONOWNERID_ATTRIB_NAME)) {
2035                         setAffiliationOwnerID(value);
2036                         return;
2037                     }
2038                     else if (XMLString::equals(qualifiedName.getLocalPart(),VALIDUNTIL_ATTRIB_NAME)) {
2039                         setValidUntil(value);
2040                         return;
2041                     }
2042                     else if (XMLString::equals(qualifiedName.getLocalPart(),CACHEDURATION_ATTRIB_NAME)) {
2043                         setCacheDuration(value);
2044                         return;
2045                     }
2046                 }
2047                 AbstractAttributeExtensibleXMLObject::setAttribute(qualifiedName, value, ID);
2048             }
2049
2050         protected:
2051             void marshallAttributes(DOMElement* domElement) const {
2052                 MARSHALL_ID_ATTRIB(ID,ID,NULL);
2053                 MARSHALL_STRING_ATTRIB(AffiliationOwnerID,AFFILIATIONOWNERID,NULL);
2054                 MARSHALL_DATETIME_ATTRIB(ValidUntil,VALIDUNTIL,NULL);
2055                 MARSHALL_DATETIME_ATTRIB(CacheDuration,CACHEDURATION,NULL);
2056                 marshallExtensionAttributes(domElement);
2057             }
2058
2059             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
2060                 PROC_TYPED_FOREIGN_CHILD(Signature,xmlsignature,XMLSIG_NS,false);
2061                 PROC_TYPED_CHILD(Extensions,SAML20MD_NS,false);
2062                 PROC_TYPED_CHILDREN(AffiliateMember,SAML20MD_NS,false);
2063                 PROC_TYPED_CHILDREN(KeyDescriptor,SAML20MD_NS,false);
2064                 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
2065             }
2066
2067             void processAttribute(const DOMAttr* attribute) {
2068                 PROC_ID_ATTRIB(ID,ID,NULL);
2069                 unmarshallExtensionAttribute(attribute);
2070             }
2071         };
2072
2073         class SAML_DLLLOCAL EntityDescriptorImpl : public virtual EntityDescriptor,
2074             public virtual SignableObject,
2075             public AbstractComplexElement,
2076             public AbstractAttributeExtensibleXMLObject,
2077             public AbstractDOMCachingXMLObject,
2078             public AbstractXMLObjectMarshaller,
2079             public AbstractXMLObjectUnmarshaller
2080         {
2081             list<XMLObject*>::iterator m_pos_ContactPerson;
2082
2083             void init() {
2084                 m_ID=m_EntityID=NULL;
2085                 m_ValidUntil=m_CacheDuration=NULL;
2086                 m_children.push_back(NULL);
2087                 m_children.push_back(NULL);
2088                 m_children.push_back(NULL);
2089                 m_children.push_back(NULL);
2090                 m_children.push_back(NULL);
2091                 m_Signature=NULL;
2092                 m_Extensions=NULL;
2093                 m_AffiliationDescriptor=NULL;
2094                 m_Organization=NULL;
2095                 m_pos_Signature=m_children.begin();
2096                 m_pos_Extensions=m_pos_Signature;
2097                 ++m_pos_Extensions;
2098                 m_pos_AffiliationDescriptor=m_pos_Extensions;
2099                 ++m_pos_AffiliationDescriptor;
2100                 m_pos_Organization=m_pos_AffiliationDescriptor;
2101                 ++m_pos_Organization;
2102                 m_pos_ContactPerson=m_pos_Organization;
2103                 ++m_pos_ContactPerson;
2104             }
2105
2106         public:
2107             virtual ~EntityDescriptorImpl() {
2108                 XMLString::release(&m_ID);
2109                 XMLString::release(&m_EntityID);
2110                 delete m_ValidUntil;
2111                 delete m_CacheDuration;
2112             }
2113
2114             EntityDescriptorImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
2115                 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
2116                 init();
2117             }
2118
2119             EntityDescriptorImpl(const EntityDescriptorImpl& src)
2120                     : AbstractXMLObject(src), AbstractComplexElement(src),
2121                         AbstractAttributeExtensibleXMLObject(src), AbstractDOMCachingXMLObject(src) {
2122                 init();
2123                 setID(src.getID());
2124                 setEntityID(src.getEntityID());
2125                 setValidUntil(src.getValidUntil());
2126                 setCacheDuration(src.getCacheDuration());
2127                 if (src.getSignature())
2128                     setSignature(src.getSignature()->cloneSignature());
2129                 if (src.getExtensions())
2130                     setExtensions(src.getExtensions()->cloneExtensions());
2131                 if (src.getAffiliationDescriptor())
2132                     setAffiliationDescriptor(src.getAffiliationDescriptor()->cloneAffiliationDescriptor());
2133                 if (src.getOrganization())
2134                     setOrganization(src.getOrganization()->cloneOrganization());
2135
2136                 for (list<XMLObject*>::const_iterator i=src.m_children.begin(); i!=src.m_children.end(); i++) {
2137                     if (*i) {
2138                         IDPSSODescriptor* idp=dynamic_cast<IDPSSODescriptor*>(*i);
2139                         if (idp) {
2140                             getIDPSSODescriptors().push_back(idp->cloneIDPSSODescriptor());
2141                             continue;
2142                         }
2143
2144                         SPSSODescriptor* sp=dynamic_cast<SPSSODescriptor*>(*i);
2145                         if (sp) {
2146                             getSPSSODescriptors().push_back(sp->cloneSPSSODescriptor());
2147                             continue;
2148                         }
2149
2150                         AuthnAuthorityDescriptor* authn=dynamic_cast<AuthnAuthorityDescriptor*>(*i);
2151                         if (authn) {
2152                             getAuthnAuthorityDescriptors().push_back(authn->cloneAuthnAuthorityDescriptor());
2153                             continue;
2154                         }
2155
2156                         AttributeAuthorityDescriptor* attr=dynamic_cast<AttributeAuthorityDescriptor*>(*i);
2157                         if (attr) {
2158                             getAttributeAuthorityDescriptors().push_back(attr->cloneAttributeAuthorityDescriptor());
2159                             continue;
2160                         }
2161
2162                         PDPDescriptor* pdp=dynamic_cast<PDPDescriptor*>(*i);
2163                         if (pdp) {
2164                             getPDPDescriptors().push_back(pdp->clonePDPDescriptor());
2165                             continue;
2166                         }
2167
2168                         AuthnQueryDescriptorType* authnq=dynamic_cast<AuthnQueryDescriptorType*>(*i);
2169                         if (authnq) {
2170                             getAuthnQueryDescriptorTypes().push_back(authnq->cloneAuthnQueryDescriptorType());
2171                             continue;
2172                         }
2173
2174                         AttributeQueryDescriptorType* attrq=dynamic_cast<AttributeQueryDescriptorType*>(*i);
2175                         if (attrq) {
2176                             getAttributeQueryDescriptorTypes().push_back(attrq->cloneAttributeQueryDescriptorType());
2177                             continue;
2178                         }
2179
2180                         AuthzDecisionQueryDescriptorType* authzq=dynamic_cast<AuthzDecisionQueryDescriptorType*>(*i);
2181                         if (authzq) {
2182                             getAuthzDecisionQueryDescriptorTypes().push_back(authzq->cloneAuthzDecisionQueryDescriptorType());
2183                             continue;
2184                         }
2185
2186                         RoleDescriptor* role=dynamic_cast<RoleDescriptor*>(*i);
2187                         if (role) {
2188                             getRoleDescriptors().push_back(role->cloneRoleDescriptor());
2189                             continue;
2190                         }
2191                     }
2192                 }
2193
2194                 VectorOf(ContactPerson) v=getContactPersons();
2195                 for (vector<ContactPerson*>::const_iterator j=src.m_ContactPersons.begin(); j!=src.m_ContactPersons.end(); j++) {
2196                     if (*j) {
2197                         v.push_back((*j)->cloneContactPerson());
2198                     }
2199                 }
2200                 VectorOf(AdditionalMetadataLocation) w=getAdditionalMetadataLocations();
2201                 for (vector<AdditionalMetadataLocation*>::const_iterator k=src.m_AdditionalMetadataLocations.begin(); k!=src.m_AdditionalMetadataLocations.end(); k++) {
2202                     if (*k) {
2203                         w.push_back((*k)->cloneAdditionalMetadataLocation());
2204                     }
2205                 }
2206             }
2207
2208             IMPL_XMLOBJECT_CLONE(EntityDescriptor);
2209
2210             //IMPL_TYPED_CHILD(Signature);
2211             // Need customized setter.
2212         protected:
2213             Signature* m_Signature;
2214             list<XMLObject*>::iterator m_pos_Signature;
2215         public:
2216             Signature* getSignature() const {
2217                 return m_Signature;
2218             }
2219
2220             void setSignature(Signature* sig) {
2221                 prepareForAssignment(m_Signature,sig);
2222                 *m_pos_Signature=m_Signature=sig;
2223                 // Sync content reference back up.
2224                 if (m_Signature)
2225                     m_Signature->setContentReference(new opensaml::ContentReference(*this));
2226             }
2227
2228             IMPL_ID_ATTRIB(ID);
2229             IMPL_STRING_ATTRIB(EntityID);
2230             IMPL_DATETIME_ATTRIB(ValidUntil,SAMLTIME_MAX);
2231             IMPL_DURATION_ATTRIB(CacheDuration,0);
2232             IMPL_TYPED_CHILD(Extensions);
2233             IMPL_TYPED_CHILDREN(RoleDescriptor,m_pos_AffiliationDescriptor);
2234             IMPL_TYPED_CHILDREN(IDPSSODescriptor,m_pos_AffiliationDescriptor);
2235             IMPL_TYPED_CHILDREN(SPSSODescriptor,m_pos_AffiliationDescriptor);
2236             IMPL_TYPED_CHILDREN(AuthnAuthorityDescriptor,m_pos_AffiliationDescriptor);
2237             IMPL_TYPED_CHILDREN(AttributeAuthorityDescriptor,m_pos_AffiliationDescriptor);
2238             IMPL_TYPED_CHILDREN(PDPDescriptor,m_pos_AffiliationDescriptor);
2239             IMPL_TYPED_CHILDREN(AuthnQueryDescriptorType,m_pos_AffiliationDescriptor);
2240             IMPL_TYPED_CHILDREN(AttributeQueryDescriptorType,m_pos_AffiliationDescriptor);
2241             IMPL_TYPED_CHILDREN(AuthzDecisionQueryDescriptorType,m_pos_AffiliationDescriptor);
2242             IMPL_TYPED_CHILD(AffiliationDescriptor);
2243             IMPL_TYPED_CHILD(Organization);
2244             IMPL_TYPED_CHILDREN(ContactPerson,m_pos_ContactPerson);
2245             IMPL_TYPED_CHILDREN(AdditionalMetadataLocation,m_children.end());
2246
2247             void setAttribute(const xmltooling::QName& qualifiedName, const XMLCh* value, bool ID=false) {
2248                 if (!qualifiedName.hasNamespaceURI()) {
2249                     if (XMLString::equals(qualifiedName.getLocalPart(),ID_ATTRIB_NAME)) {
2250                         setID(value);
2251                         return;
2252                     }
2253                     else if (XMLString::equals(qualifiedName.getLocalPart(),ENTITYID_ATTRIB_NAME)) {
2254                         setEntityID(value);
2255                         return;
2256                     }
2257                     else if (XMLString::equals(qualifiedName.getLocalPart(),VALIDUNTIL_ATTRIB_NAME)) {
2258                         setValidUntil(value);
2259                         return;
2260                     }
2261                     else if (XMLString::equals(qualifiedName.getLocalPart(),CACHEDURATION_ATTRIB_NAME)) {
2262                         setCacheDuration(value);
2263                         return;
2264                     }
2265                 }
2266                 AbstractAttributeExtensibleXMLObject::setAttribute(qualifiedName, value, ID);
2267             }
2268
2269             const RoleDescriptor* getRoleDescriptor(const xmltooling::QName& qname, const XMLCh* protocol) const {
2270                 // Check for "known" elements/types.
2271                 if (qname == IDPSSODescriptor::ELEMENT_QNAME)
2272                     return find_if(m_IDPSSODescriptors, isValidForProtocol(protocol));
2273                 if (qname == SPSSODescriptor::ELEMENT_QNAME)
2274                     return find_if(m_SPSSODescriptors, isValidForProtocol(protocol));
2275                 if (qname == AuthnAuthorityDescriptor::ELEMENT_QNAME)
2276                     return find_if(m_AuthnAuthorityDescriptors, isValidForProtocol(protocol));
2277                 if (qname == AttributeAuthorityDescriptor::ELEMENT_QNAME)
2278                     return find_if(m_AttributeAuthorityDescriptors, isValidForProtocol(protocol));
2279                 if (qname == PDPDescriptor::ELEMENT_QNAME)
2280                     return find_if(m_PDPDescriptors, isValidForProtocol(protocol));
2281                 if (qname == AuthnQueryDescriptorType::TYPE_QNAME)
2282                     return find_if(m_AuthnQueryDescriptorTypes, isValidForProtocol(protocol));
2283                 if (qname == AttributeQueryDescriptorType::TYPE_QNAME)
2284                     return find_if(m_AttributeQueryDescriptorTypes, isValidForProtocol(protocol));
2285                 if (qname == AuthzDecisionQueryDescriptorType::TYPE_QNAME)
2286                     return find_if(m_AuthzDecisionQueryDescriptorTypes, isValidForProtocol(protocol));
2287
2288                 vector<RoleDescriptor*>::const_iterator i =
2289                     find_if(m_RoleDescriptors.begin(), m_RoleDescriptors.end(), ofTypeValidForProtocol(qname,protocol));
2290                 return (i!=m_RoleDescriptors.end()) ? *i : NULL;
2291             }
2292
2293         protected:
2294             void marshallAttributes(DOMElement* domElement) const {
2295                 MARSHALL_ID_ATTRIB(ID,ID,NULL);
2296                 MARSHALL_STRING_ATTRIB(EntityID,ENTITYID,NULL);
2297                 MARSHALL_DATETIME_ATTRIB(ValidUntil,VALIDUNTIL,NULL);
2298                 MARSHALL_DATETIME_ATTRIB(CacheDuration,CACHEDURATION,NULL);
2299                 marshallExtensionAttributes(domElement);
2300             }
2301
2302             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
2303                 PROC_TYPED_FOREIGN_CHILD(Signature,xmlsignature,XMLSIG_NS,false);
2304                 PROC_TYPED_CHILD(Extensions,SAML20MD_NS,false);
2305                 PROC_TYPED_CHILDREN(IDPSSODescriptor,SAML20MD_NS,false);
2306                 PROC_TYPED_CHILDREN(SPSSODescriptor,SAML20MD_NS,false);
2307                 PROC_TYPED_CHILDREN(AuthnAuthorityDescriptor,SAML20MD_NS,false);
2308                 PROC_TYPED_CHILDREN(AttributeAuthorityDescriptor,SAML20MD_NS,false);
2309                 PROC_TYPED_CHILDREN(PDPDescriptor,SAML20MD_NS,false);
2310                 PROC_TYPED_CHILDREN(AuthnQueryDescriptorType,samlconstants::SAML20MD_QUERY_EXT_NS,false);
2311                 PROC_TYPED_CHILDREN(AttributeQueryDescriptorType,samlconstants::SAML20MD_QUERY_EXT_NS,false);
2312                 PROC_TYPED_CHILDREN(AuthzDecisionQueryDescriptorType,samlconstants::SAML20MD_QUERY_EXT_NS,false);
2313                 PROC_TYPED_CHILDREN(RoleDescriptor,SAML20MD_NS,false);
2314                 PROC_TYPED_CHILD(AffiliationDescriptor,SAML20MD_NS,false);
2315                 PROC_TYPED_CHILD(Organization,SAML20MD_NS,false);
2316                 PROC_TYPED_CHILDREN(ContactPerson,SAML20MD_NS,false);
2317                 PROC_TYPED_CHILDREN(AdditionalMetadataLocation,SAML20MD_NS,false);
2318                 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
2319             }
2320
2321             void processAttribute(const DOMAttr* attribute) {
2322                 PROC_ID_ATTRIB(ID,ID,NULL);
2323                 unmarshallExtensionAttribute(attribute);
2324             }
2325         };
2326
2327         class SAML_DLLLOCAL EntitiesDescriptorImpl : public virtual EntitiesDescriptor,
2328             public virtual SignableObject,
2329             public AbstractComplexElement,
2330             public AbstractDOMCachingXMLObject,
2331             public AbstractXMLObjectMarshaller,
2332             public AbstractXMLObjectUnmarshaller
2333         {
2334             void init() {
2335                 m_ID=m_Name=NULL;
2336                 m_ValidUntil=m_CacheDuration=NULL;
2337                 m_children.push_back(NULL);
2338                 m_children.push_back(NULL);
2339                 m_Signature=NULL;
2340                 m_Extensions=NULL;
2341                 m_pos_Signature=m_children.begin();
2342                 m_pos_Extensions=m_pos_Signature;
2343                 ++m_pos_Extensions;
2344             }
2345
2346         public:
2347             virtual ~EntitiesDescriptorImpl() {
2348                 XMLString::release(&m_ID);
2349                 XMLString::release(&m_Name);
2350                 delete m_ValidUntil;
2351                 delete m_CacheDuration;
2352             }
2353
2354             EntitiesDescriptorImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
2355                 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
2356                 init();
2357             }
2358
2359             EntitiesDescriptorImpl(const EntitiesDescriptorImpl& src)
2360                     : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
2361                 init();
2362                 setID(src.getID());
2363                 setName(src.getName());
2364                 setValidUntil(src.getValidUntil());
2365                 setCacheDuration(src.getCacheDuration());
2366                 if (src.getSignature())
2367                     setSignature(src.getSignature()->cloneSignature());
2368                 if (src.getExtensions())
2369                     setExtensions(src.getExtensions()->cloneExtensions());
2370
2371                 for (list<XMLObject*>::const_iterator i=src.m_children.begin(); i!=src.m_children.end(); i++) {
2372                     if (*i) {
2373                         EntityDescriptor* e=dynamic_cast<EntityDescriptor*>(*i);
2374                         if (e) {
2375                             getEntityDescriptors().push_back(e->cloneEntityDescriptor());
2376                             continue;
2377                         }
2378
2379                         EntitiesDescriptor* es=dynamic_cast<EntitiesDescriptor*>(*i);
2380                         if (es) {
2381                             getEntitiesDescriptors().push_back(es->cloneEntitiesDescriptor());
2382                             continue;
2383                         }
2384                     }
2385                 }
2386             }
2387
2388             IMPL_XMLOBJECT_CLONE(EntitiesDescriptor);
2389
2390             //IMPL_TYPED_CHILD(Signature);
2391             // Need customized setter.
2392         protected:
2393             Signature* m_Signature;
2394             list<XMLObject*>::iterator m_pos_Signature;
2395         public:
2396             Signature* getSignature() const {
2397                 return m_Signature;
2398             }
2399
2400             void setSignature(Signature* sig) {
2401                 prepareForAssignment(m_Signature,sig);
2402                 *m_pos_Signature=m_Signature=sig;
2403                 // Sync content reference back up.
2404                 if (m_Signature)
2405                     m_Signature->setContentReference(new opensaml::ContentReference(*this));
2406             }
2407
2408             IMPL_ID_ATTRIB(ID);
2409             IMPL_STRING_ATTRIB(Name);
2410             IMPL_DATETIME_ATTRIB(ValidUntil,SAMLTIME_MAX);
2411             IMPL_DURATION_ATTRIB(CacheDuration,0);
2412             IMPL_TYPED_CHILD(Extensions);
2413             IMPL_TYPED_CHILDREN(EntityDescriptor,m_children.end());
2414             IMPL_TYPED_CHILDREN(EntitiesDescriptor,m_children.end());
2415
2416         protected:
2417             void marshallAttributes(DOMElement* domElement) const {
2418                 MARSHALL_ID_ATTRIB(ID,ID,NULL);
2419                 MARSHALL_STRING_ATTRIB(Name,NAME,NULL);
2420                 MARSHALL_DATETIME_ATTRIB(ValidUntil,VALIDUNTIL,NULL);
2421                 MARSHALL_DATETIME_ATTRIB(CacheDuration,CACHEDURATION,NULL);
2422             }
2423
2424             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
2425                 PROC_TYPED_FOREIGN_CHILD(Signature,xmlsignature,XMLSIG_NS,false);
2426                 PROC_TYPED_CHILD(Extensions,SAML20MD_NS,false);
2427                 PROC_TYPED_CHILDREN(EntityDescriptor,SAML20MD_NS,false);
2428                 PROC_TYPED_CHILDREN(EntitiesDescriptor,SAML20MD_NS,false);
2429                 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
2430             }
2431
2432             void processAttribute(const DOMAttr* attribute) {
2433                 PROC_ID_ATTRIB(ID,ID,NULL);
2434                 PROC_STRING_ATTRIB(Name,NAME,NULL);
2435                 PROC_DATETIME_ATTRIB(ValidUntil,VALIDUNTIL,NULL);
2436                 PROC_DATETIME_ATTRIB(CacheDuration,CACHEDURATION,NULL);
2437             }
2438         };
2439
2440         class SAML_DLLLOCAL EntityAttributesImpl : public virtual EntityAttributes,
2441             public AbstractComplexElement,
2442             public AbstractDOMCachingXMLObject,
2443             public AbstractXMLObjectMarshaller,
2444             public AbstractXMLObjectUnmarshaller
2445         {
2446         public:
2447             virtual ~EntityAttributesImpl() {}
2448
2449             EntityAttributesImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType)
2450                 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
2451             }
2452
2453             EntityAttributesImpl(const EntityAttributesImpl& src)
2454                     : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
2455                 for (list<XMLObject*>::const_iterator i=src.m_children.begin(); i!=src.m_children.end(); i++) {
2456                     if (*i) {
2457                         Attribute* a=dynamic_cast<Attribute*>(*i);
2458                         if (a) {
2459                             getAttributes().push_back(a->cloneAttribute());
2460                             continue;
2461                         }
2462
2463                         saml2::Assertion* as=dynamic_cast<saml2::Assertion*>(*i);
2464                         if (as) {
2465                             getAssertions().push_back(as->cloneAssertion());
2466                             continue;
2467                         }
2468                     }
2469                 }
2470             }
2471
2472             IMPL_XMLOBJECT_CLONE(EntityAttributes);
2473
2474             IMPL_TYPED_FOREIGN_CHILDREN(Attribute,saml2,m_children.end());
2475             IMPL_TYPED_FOREIGN_CHILDREN(Assertion,saml2,m_children.end());
2476
2477         protected:
2478             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
2479                 PROC_TYPED_FOREIGN_CHILDREN(Attribute,saml2,SAML20_NS,false);
2480                 PROC_TYPED_FOREIGN_CHILDREN(Assertion,saml2,SAML20_NS,false);
2481                 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
2482             }
2483         };
2484     };
2485 };
2486
2487 #if defined (_MSC_VER)
2488     #pragma warning( pop )
2489 #endif
2490
2491 IMPL_ELEMENT_QNAME(IDPSSODescriptor, SAML20MD_NS, SAML20MD_PREFIX);
2492 IMPL_ELEMENT_QNAME(SPSSODescriptor, SAML20MD_NS, SAML20MD_PREFIX);
2493 IMPL_ELEMENT_QNAME(AuthnAuthorityDescriptor, SAML20MD_NS, SAML20MD_PREFIX);
2494 IMPL_ELEMENT_QNAME(AttributeAuthorityDescriptor, SAML20MD_NS, SAML20MD_PREFIX);
2495 IMPL_ELEMENT_QNAME(PDPDescriptor, SAML20MD_NS, SAML20MD_PREFIX);
2496 IMPL_TYPE_QNAME(AuthnQueryDescriptorType, SAML20MD_QUERY_EXT_NS, SAML20MD_QUERY_EXT_PREFIX);
2497 IMPL_TYPE_QNAME(AttributeQueryDescriptorType, SAML20MD_QUERY_EXT_NS, SAML20MD_QUERY_EXT_PREFIX);
2498 IMPL_TYPE_QNAME(AuthzDecisionQueryDescriptorType, SAML20MD_QUERY_EXT_NS, SAML20MD_QUERY_EXT_PREFIX);
2499
2500 // Builder Implementations
2501
2502 IMPL_XMLOBJECTBUILDER(AdditionalMetadataLocation);
2503 IMPL_XMLOBJECTBUILDER(AffiliateMember);
2504 IMPL_XMLOBJECTBUILDER(AffiliationDescriptor);
2505 IMPL_XMLOBJECTBUILDER(ArtifactResolutionService);
2506 IMPL_XMLOBJECTBUILDER(AssertionConsumerService);
2507 IMPL_XMLOBJECTBUILDER(AssertionIDRequestService);
2508 IMPL_XMLOBJECTBUILDER(AttributeAuthorityDescriptor);
2509 IMPL_XMLOBJECTBUILDER(AttributeConsumingService);
2510 IMPL_XMLOBJECTBUILDER(AttributeProfile);
2511 IMPL_XMLOBJECTBUILDER(AttributeQueryDescriptorType);
2512 IMPL_XMLOBJECTBUILDER(AttributeService);
2513 IMPL_XMLOBJECTBUILDER(AuthnAuthorityDescriptor);
2514 IMPL_XMLOBJECTBUILDER(AuthnQueryDescriptorType);
2515 IMPL_XMLOBJECTBUILDER(AuthnQueryService);
2516 IMPL_XMLOBJECTBUILDER(AuthzDecisionQueryDescriptorType);
2517 IMPL_XMLOBJECTBUILDER(AuthzService);
2518 IMPL_XMLOBJECTBUILDER(Company);
2519 IMPL_XMLOBJECTBUILDER(ContactPerson);
2520 IMPL_XMLOBJECTBUILDER(EmailAddress);
2521 IMPL_XMLOBJECTBUILDER(EndpointType);
2522 IMPL_XMLOBJECTBUILDER(EntitiesDescriptor);
2523 IMPL_XMLOBJECTBUILDER(EntityDescriptor);
2524 IMPL_XMLOBJECTBUILDER(Extensions);
2525 IMPL_XMLOBJECTBUILDER(GivenName);
2526 IMPL_XMLOBJECTBUILDER(IDPSSODescriptor);
2527 IMPL_XMLOBJECTBUILDER(IndexedEndpointType);
2528 IMPL_XMLOBJECTBUILDER(KeyDescriptor);
2529 IMPL_XMLOBJECTBUILDER(localizedNameType);
2530 IMPL_XMLOBJECTBUILDER(localizedURIType);
2531 IMPL_XMLOBJECTBUILDER(ManageNameIDService);
2532 IMPL_XMLOBJECTBUILDER(NameIDFormat);
2533 IMPL_XMLOBJECTBUILDER(NameIDMappingService);
2534 IMPL_XMLOBJECTBUILDER(Organization);
2535 IMPL_XMLOBJECTBUILDER(OrganizationName);
2536 IMPL_XMLOBJECTBUILDER(OrganizationDisplayName);
2537 IMPL_XMLOBJECTBUILDER(OrganizationURL);
2538 IMPL_XMLOBJECTBUILDER(PDPDescriptor);
2539 IMPL_XMLOBJECTBUILDER(RequestedAttribute);
2540 IMPL_XMLOBJECTBUILDER(ServiceDescription);
2541 IMPL_XMLOBJECTBUILDER(ServiceName);
2542 IMPL_XMLOBJECTBUILDER(SingleLogoutService);
2543 IMPL_XMLOBJECTBUILDER(SingleSignOnService);
2544 IMPL_XMLOBJECTBUILDER(SPSSODescriptor);
2545 IMPL_XMLOBJECTBUILDER(SurName);
2546 IMPL_XMLOBJECTBUILDER(TelephoneNumber);
2547
2548 IMPL_XMLOBJECTBUILDER(ActionNamespace);
2549 IMPL_XMLOBJECTBUILDER(SourceID);
2550 IMPL_XMLOBJECTBUILDER(EntityAttributes);
2551
2552 #ifdef HAVE_COVARIANT_RETURNS
2553 RoleDescriptor* RoleDescriptorBuilder::buildObject(
2554 #else
2555 xmltooling::XMLObject* RoleDescriptorBuilder::buildObject(
2556 #endif
2557     const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const xmltooling::QName* schemaType
2558     ) const
2559 {
2560     return new RoleDescriptorTypeImpl(nsURI,localName,prefix,schemaType);
2561 }
2562
2563 const XMLCh ActionNamespace::LOCAL_NAME[] =             UNICODE_LITERAL_15(A,c,t,i,o,n,N,a,m,e,s,p,a,c,e);
2564 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);
2565 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);
2566 const XMLCh AdditionalMetadataLocation::NAMESPACE_ATTRIB_NAME[] =   UNICODE_LITERAL_9(n,a,m,e,s,p,a,c,e);
2567 const XMLCh AffiliateMember::LOCAL_NAME[] =             UNICODE_LITERAL_15(A,f,f,i,l,i,a,t,e,M,e,m,b,e,r);
2568 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);
2569 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);
2570 const XMLCh AffiliationDescriptor::ID_ATTRIB_NAME[] =   UNICODE_LITERAL_2(I,D);
2571 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);
2572 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);
2573 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);
2574 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);
2575 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);
2576 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);
2577 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);
2578 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);
2579 const XMLCh AttributeConsumingService::INDEX_ATTRIB_NAME[] =    UNICODE_LITERAL_5(i,n,d,e,x);
2580 const XMLCh AttributeConsumingService::ISDEFAULT_ATTRIB_NAME[] =    UNICODE_LITERAL_9(i,s,D,e,f,a,u,l,t);
2581 const XMLCh AttributeProfile::LOCAL_NAME[] =            UNICODE_LITERAL_16(A,t,t,r,i,b,u,t,e,P,r,o,f,i,l,e);
2582 const XMLCh AttributeQueryDescriptorType::LOCAL_NAME[] =UNICODE_LITERAL_14(R,o,l,e,D,e,s,c,r,i,p,t,o,r);
2583 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);
2584 const XMLCh AttributeService::LOCAL_NAME[] =            UNICODE_LITERAL_16(A,t,t,r,i,b,u,t,e,S,e,r,v,i,c,e);
2585 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);
2586 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);
2587 const XMLCh AuthnQueryDescriptorType::LOCAL_NAME[] =    UNICODE_LITERAL_14(R,o,l,e,D,e,s,c,r,i,p,t,o,r);
2588 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);
2589 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);
2590 const XMLCh AuthzDecisionQueryDescriptorType::LOCAL_NAME[] =    UNICODE_LITERAL_14(R,o,l,e,D,e,s,c,r,i,p,t,o,r);
2591 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);
2592 const XMLCh AuthzService::LOCAL_NAME[] =                UNICODE_LITERAL_12(A,u,t,h,z,S,e,r,v,i,c,e);
2593 const XMLCh CacheableSAMLObject::CACHEDURATION_ATTRIB_NAME[] =  UNICODE_LITERAL_13(c,a,c,h,e,D,u,r,a,t,i,o,n);
2594 const XMLCh Company::LOCAL_NAME[] =                     UNICODE_LITERAL_7(C,o,m,p,a,n,y);
2595 const XMLCh ContactPerson::LOCAL_NAME[] =               UNICODE_LITERAL_13(C,o,n,t,a,c,t,P,e,r,s,o,n);
2596 const XMLCh ContactPerson::TYPE_NAME[] =                UNICODE_LITERAL_11(C,o,n,t,a,c,t,T,y,p,e);
2597 const XMLCh ContactPerson::CONTACTTYPE_ATTRIB_NAME[] =  UNICODE_LITERAL_11(c,o,n,t,a,c,t,T,y,p,e);
2598 const XMLCh ContactPerson::CONTACT_TECHNICAL[] =        UNICODE_LITERAL_9(t,e,c,h,n,i,c,a,l);
2599 const XMLCh ContactPerson::CONTACT_SUPPORT[] =          UNICODE_LITERAL_7(s,u,p,p,o,r,t);
2600 const XMLCh ContactPerson::CONTACT_ADMINISTRATIVE[] =   UNICODE_LITERAL_14(a,d,m,i,n,i,s,t,r,a,t,i,v,e);
2601 const XMLCh ContactPerson::CONTACT_BILLING[] =          UNICODE_LITERAL_7(b,i,l,l,i,n,g);
2602 const XMLCh ContactPerson::CONTACT_OTHER[] =            UNICODE_LITERAL_5(o,t,h,e,r);
2603 const XMLCh EmailAddress::LOCAL_NAME[] =                UNICODE_LITERAL_12(E,m,a,i,l,A,d,d,r,e,s,s);
2604 const XMLCh EndpointType::LOCAL_NAME[] =                {chNull};
2605 const XMLCh EndpointType::TYPE_NAME[] =                 UNICODE_LITERAL_12(E,n,d,p,o,i,n,t,T,y,p,e);
2606 const XMLCh EndpointType::BINDING_ATTRIB_NAME[] =       UNICODE_LITERAL_7(B,i,n,d,i,n,g);
2607 const XMLCh EndpointType::LOCATION_ATTRIB_NAME[] =      UNICODE_LITERAL_8(L,o,c,a,t,i,o,n);
2608 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);
2609 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);
2610 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);
2611 const XMLCh EntitiesDescriptor::ID_ATTRIB_NAME[] =      UNICODE_LITERAL_2(I,D);
2612 const XMLCh EntitiesDescriptor::NAME_ATTRIB_NAME[] =    UNICODE_LITERAL_4(N,a,m,e);
2613 const XMLCh EntityDescriptor::LOCAL_NAME[] =            UNICODE_LITERAL_16(E,n,t,i,t,y,D,e,s,c,r,i,p,t,o,r);
2614 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);
2615 const XMLCh EntityDescriptor::ID_ATTRIB_NAME[] =        UNICODE_LITERAL_2(I,D);
2616 const XMLCh EntityDescriptor::ENTITYID_ATTRIB_NAME[] =  UNICODE_LITERAL_8(e,n,t,i,t,y,I,D);
2617 const XMLCh EntityAttributes::LOCAL_NAME[] =            UNICODE_LITERAL_16(E,n,t,i,t,y,A,t,t,r,i,b,u,t,e,s);
2618 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);
2619 const XMLCh Extensions::LOCAL_NAME[] =                  UNICODE_LITERAL_10(E,x,t,e,n,s,i,o,n,s);
2620 const XMLCh Extensions::TYPE_NAME[] =                   UNICODE_LITERAL_14(E,x,t,e,n,s,i,o,n,s,T,y,p,e);
2621 const XMLCh GivenName::LOCAL_NAME[] =                   UNICODE_LITERAL_9(G,i,v,e,n,N,a,m,e);
2622 const XMLCh IDPSSODescriptor::LOCAL_NAME[] =            UNICODE_LITERAL_16(I,D,P,S,S,O,D,e,s,c,r,i,p,t,o,r);
2623 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);
2624 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);
2625 const XMLCh IndexedEndpointType::LOCAL_NAME[] =         {chNull};
2626 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);
2627 const XMLCh IndexedEndpointType::INDEX_ATTRIB_NAME[] =  UNICODE_LITERAL_5(i,n,d,e,x);
2628 const XMLCh IndexedEndpointType::ISDEFAULT_ATTRIB_NAME[] =  UNICODE_LITERAL_9(i,s,D,e,f,a,u,l,t);
2629 const XMLCh KeyDescriptor::LOCAL_NAME[] =               UNICODE_LITERAL_13(K,e,y,D,e,s,c,r,i,p,t,o,r);
2630 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);
2631 const XMLCh KeyDescriptor::USE_ATTRIB_NAME[] =          UNICODE_LITERAL_3(u,s,e);
2632 const XMLCh KeyDescriptor::KEYTYPE_ENCRYPTION[] =       UNICODE_LITERAL_10(e,n,c,r,y,p,t,i,o,n);
2633 const XMLCh KeyDescriptor::KEYTYPE_SIGNING[] =          UNICODE_LITERAL_7(s,i,g,n,i,n,g);
2634 const XMLCh localizedNameType::LOCAL_NAME[] =           {chNull};
2635 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);
2636 const XMLCh localizedNameType::LANG_ATTRIB_NAME[] =     UNICODE_LITERAL_4(l,a,n,g);
2637 const XMLCh localizedURIType::LOCAL_NAME[] =            {chNull};
2638 const XMLCh localizedURIType::TYPE_NAME[] =             UNICODE_LITERAL_16(l,o,c,a,l,i,z,e,d,U,R,I,T,y,p,e);
2639 const XMLCh localizedURIType::LANG_ATTRIB_NAME[] =      UNICODE_LITERAL_4(l,a,n,g);
2640 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);
2641 const XMLCh NameIDFormat::LOCAL_NAME[] =                UNICODE_LITERAL_12(N,a,m,e,I,D,F,o,r,m,a,t);
2642 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);
2643 const XMLCh Organization::LOCAL_NAME[] =                UNICODE_LITERAL_12(O,r,g,a,n,i,z,a,t,i,o,n);
2644 const XMLCh Organization::TYPE_NAME[] =                 UNICODE_LITERAL_16(O,r,g,a,n,i,z,a,t,i,o,n,T,y,p,e);
2645 const XMLCh OrganizationName::LOCAL_NAME[] =            UNICODE_LITERAL_16(O,r,g,a,n,i,z,a,t,i,o,n,N,a,m,e);
2646 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);
2647 const XMLCh OrganizationURL::LOCAL_NAME[] =             UNICODE_LITERAL_15(O,r,g,a,n,i,z,a,t,i,o,n,U,R,L);
2648 const XMLCh PDPDescriptor::LOCAL_NAME[] =               UNICODE_LITERAL_13(P,D,P,D,e,s,c,r,i,p,t,o,r);
2649 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);
2650 const XMLCh QueryDescriptorType::LOCAL_NAME[] =         {chNull};
2651 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);
2652 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);
2653 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);
2654 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);
2655 const XMLCh RequestedAttribute::ISREQUIRED_ATTRIB_NAME[] =  UNICODE_LITERAL_10(i,s,R,e,q,u,i,r,e,d);
2656 const XMLCh RoleDescriptor::LOCAL_NAME[] =              UNICODE_LITERAL_14(R,o,l,e,D,e,s,c,r,i,p,t,o,r);
2657 const XMLCh RoleDescriptor::ID_ATTRIB_NAME[] =          UNICODE_LITERAL_2(I,D);
2658 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);
2659 const XMLCh RoleDescriptor::ERRORURL_ATTRIB_NAME[] =    UNICODE_LITERAL_8(e,r,r,o,r,U,R,L);
2660 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);
2661 const XMLCh ServiceName::LOCAL_NAME[] =                 UNICODE_LITERAL_11(S,e,r,v,i,c,e,N,a,m,e);
2662 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);
2663 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);
2664 const XMLCh SourceID::LOCAL_NAME[] =                    UNICODE_LITERAL_8(S,o,u,r,c,e,I,D);
2665 const XMLCh SPSSODescriptor::LOCAL_NAME[] =             UNICODE_LITERAL_15(S,P,S,S,O,D,e,s,c,r,i,p,t,o,r);
2666 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);
2667 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);
2668 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);
2669 const XMLCh SSODescriptorType::LOCAL_NAME[] =           {chNull};
2670 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);
2671 const XMLCh SurName::LOCAL_NAME[] =                     UNICODE_LITERAL_7(S,u,r,N,a,m,e);
2672 const XMLCh TelephoneNumber::LOCAL_NAME[] =             UNICODE_LITERAL_15(T,e,l,e,p,h,o,n,e,N,u,m,b,e,r);
2673 const XMLCh TimeBoundSAMLObject::VALIDUNTIL_ATTRIB_NAME[] =   UNICODE_LITERAL_10(v,a,l,i,d,U,n,t,i,l);