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