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