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