15e9140be30aec23e7eeea6583ee5a43366ddd44
[shibboleth/cpp-opensaml.git] / saml / saml2 / core / impl / Protocols20Impl.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  * Protocols20Impl.cpp
19  * 
20  * Implementation classes for SAML 2.0 Protocols schema
21  */
22
23 #include "internal.h"
24 #include "exceptions.h"
25 #include "saml/encryption/EncryptedKeyResolver.h"
26 #include "saml2/core/Protocols.h"
27
28 #include <xmltooling/AbstractChildlessElement.h>
29 #include <xmltooling/AbstractComplexElement.h>
30 #include <xmltooling/AbstractElementProxy.h>
31 #include <xmltooling/AbstractSimpleElement.h>
32 #include <xmltooling/encryption/Decrypter.h>
33 #include <xmltooling/impl/AnyElement.h>
34 #include <xmltooling/io/AbstractXMLObjectMarshaller.h>
35 #include <xmltooling/io/AbstractXMLObjectUnmarshaller.h>
36 #include <xmltooling/util/XMLHelper.h>
37
38 #include <ctime>
39 #include <xercesc/util/XMLUniDefs.hpp>
40
41 using namespace opensaml::saml2p;
42 using namespace opensaml::saml2;
43 using namespace opensaml;
44 using namespace xmlsignature;
45 using namespace xmlencryption;
46 using namespace xmltooling;
47 using namespace std;
48
49 #if defined (_MSC_VER)
50     #pragma warning( push )
51     #pragma warning( disable : 4250 4251 )
52 #endif
53
54 namespace opensaml {
55     namespace saml2p {
56
57         DECL_XMLOBJECTIMPL_SIMPLE(SAML_DLLLOCAL,Artifact);
58         DECL_XMLOBJECTIMPL_SIMPLE(SAML_DLLLOCAL,GetComplete);
59         DECL_XMLOBJECTIMPL_SIMPLE(SAML_DLLLOCAL,NewID);
60         DECL_XMLOBJECTIMPL_SIMPLE(SAML_DLLLOCAL,RequesterID);
61         DECL_XMLOBJECTIMPL_SIMPLE(SAML_DLLLOCAL,SessionIndex);
62         DECL_XMLOBJECTIMPL_SIMPLE(SAML_DLLLOCAL,StatusMessage);
63
64         DECL_XMLOBJECTIMPL_SIMPLE(SAML_DLLLOCAL,RespondTo);
65
66         //TODO need unit test for this, using objects from another namespace
67         class SAML_DLLLOCAL ExtensionsImpl : public virtual Extensions,
68              public AbstractElementProxy,
69              public AbstractDOMCachingXMLObject,
70              public AbstractXMLObjectMarshaller,
71              public AbstractXMLObjectUnmarshaller
72         {
73         public:
74             virtual ~ExtensionsImpl() {}
75     
76             ExtensionsImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
77                 : AbstractXMLObject(nsURI, localName, prefix, schemaType) {
78             }
79                 
80             ExtensionsImpl(const ExtensionsImpl& src)
81                     : AbstractXMLObject(src), AbstractElementProxy(src), AbstractDOMCachingXMLObject(src) {
82                 for (list<XMLObject*>::const_iterator i=src.m_children.begin(); i!=src.m_children.end(); i++) {
83                     if (*i) {
84                         getXMLObjects().push_back((*i)->clone());
85                     }
86                 }
87             }
88             
89             IMPL_XMLOBJECT_CLONE(Extensions);
90     
91         protected:
92             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
93                 // Unknown child.
94                 const XMLCh* nsURI=root->getNamespaceURI();
95                 if (!XMLString::equals(nsURI,SAMLConstants::SAML20P_NS) && nsURI && *nsURI) {
96                     getXMLObjects().push_back(childXMLObject);
97                     return;
98                 }
99                 
100                 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
101             }
102         };
103
104         class SAML_DLLLOCAL StatusCodeImpl : public virtual StatusCode,
105              public AbstractComplexElement,
106              public AbstractDOMCachingXMLObject,
107              public AbstractXMLObjectMarshaller,
108              public AbstractXMLObjectUnmarshaller
109         {
110             void init() {
111                 m_Value=NULL;
112                 m_StatusCode=NULL;
113                 m_children.push_back(NULL);
114                 m_pos_StatusCode=m_children.begin();
115             }
116             public:
117                 virtual ~StatusCodeImpl() {}
118
119                 StatusCodeImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
120                     : AbstractXMLObject(nsURI, localName, prefix, schemaType)
121                 {
122                         init();
123                 }
124
125                 StatusCodeImpl(const StatusCodeImpl& src) : AbstractXMLObject(src), AbstractDOMCachingXMLObject(src) {
126                     init();
127                     setValue(src.getValue());
128                     if (src.getStatusCode())
129                         setStatusCode(src.getStatusCode()->cloneStatusCode());
130                 }
131
132                 IMPL_XMLOBJECT_CLONE(StatusCode);
133                 IMPL_STRING_ATTRIB(Value);
134                 IMPL_TYPED_CHILD(StatusCode);
135
136             protected:
137                 void marshallAttributes(DOMElement* domElement) const {
138                     MARSHALL_STRING_ATTRIB(Value,VALUE,NULL);
139                 }
140
141                 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
142                     PROC_TYPED_CHILD(StatusCode,SAMLConstants::SAML20P_NS,false);
143                     AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
144                 }
145
146                 void processAttribute(const DOMAttr* attribute) {
147                     PROC_STRING_ATTRIB(Value,VALUE,NULL);
148                     AbstractXMLObjectUnmarshaller::processAttribute(attribute);
149                 }
150         };
151
152         //TODO need unit tests for non-SAML namespace children
153         class SAML_DLLLOCAL StatusDetailImpl : public virtual StatusDetail,
154             public AbstractComplexElement,
155             public AbstractDOMCachingXMLObject,
156             public AbstractXMLObjectMarshaller,
157             public AbstractXMLObjectUnmarshaller
158         {
159             public:
160                 virtual ~StatusDetailImpl() {}
161
162                 StatusDetailImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
163                     : AbstractXMLObject(nsURI, localName, prefix, schemaType) { }
164
165                 StatusDetailImpl(const StatusDetailImpl& src) : AbstractXMLObject(src), AbstractDOMCachingXMLObject(src) {
166                         VectorOf(XMLObject) v=getDetails();
167                         for (vector<XMLObject*>::const_iterator i=src.m_Details.begin(); i!=src.m_Details.end(); i++) {
168                             if (*i) {
169                                 v.push_back((*i)->clone());
170                             }
171                         }
172                     }
173
174                 IMPL_XMLOBJECT_CLONE(StatusDetail);
175                 IMPL_XMLOBJECT_CHILDREN(Detail,m_children.end());
176
177             protected:
178                 void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
179                     getDetails().push_back(childXMLObject);
180                     AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
181                 }
182         };
183
184
185         class SAML_DLLLOCAL StatusImpl : public virtual Status,
186              public AbstractComplexElement,
187              public AbstractDOMCachingXMLObject,
188              public AbstractXMLObjectMarshaller,
189              public AbstractXMLObjectUnmarshaller
190         {
191             void init() {
192                 m_StatusCode=NULL;
193                 m_StatusMessage=NULL;
194                 m_StatusDetail=NULL;
195                 m_children.push_back(NULL);
196                 m_children.push_back(NULL);
197                 m_children.push_back(NULL);
198                 m_pos_StatusCode=m_children.begin();
199                 m_pos_StatusMessage=m_pos_StatusCode;
200                 ++m_pos_StatusMessage;
201                 m_pos_StatusDetail=m_pos_StatusMessage;
202                 ++m_pos_StatusDetail;
203             }
204         public:
205             virtual ~StatusImpl() { }
206     
207             StatusImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
208                 : AbstractXMLObject(nsURI, localName, prefix, schemaType)
209             {
210                     init();
211             }
212                 
213             StatusImpl(const StatusImpl& src) : AbstractXMLObject(src), AbstractDOMCachingXMLObject(src) {
214                 init();
215                 if (src.getStatusCode())
216                     setStatusCode(src.getStatusCode()->cloneStatusCode());
217                 if (src.getStatusMessage())
218                     setStatusMessage(src.getStatusMessage()->cloneStatusMessage());
219                 if (src.getStatusDetail())
220                     setStatusDetail(src.getStatusDetail()->cloneStatusDetail());
221             }
222             
223             IMPL_XMLOBJECT_CLONE(Status);
224             IMPL_TYPED_CHILD(StatusCode);
225             IMPL_TYPED_CHILD(StatusMessage);
226             IMPL_TYPED_CHILD(StatusDetail);
227     
228         protected:
229     
230             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
231                 PROC_TYPED_CHILD(StatusCode,SAMLConstants::SAML20P_NS,false);
232                 PROC_TYPED_CHILD(StatusMessage,SAMLConstants::SAML20P_NS,false);
233                 PROC_TYPED_CHILD(StatusDetail,SAMLConstants::SAML20P_NS,false);
234                 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
235             }
236     
237         };
238
239
240         class SAML_DLLLOCAL RequestImpl : public virtual Request,
241             public AbstractComplexElement,
242             public AbstractDOMCachingXMLObject,
243             public AbstractXMLObjectMarshaller,
244             public AbstractXMLObjectUnmarshaller
245         {
246             void init() {
247                 m_ID=NULL;
248                 m_Version=NULL;
249                 m_IssueInstant=NULL;
250                 m_Destination=NULL;
251                 m_Consent=NULL;
252                 m_Issuer=NULL;
253                 m_Signature=NULL;
254                 m_Extensions=NULL;
255                 m_children.push_back(NULL);
256                 m_children.push_back(NULL);
257                 m_children.push_back(NULL);
258                 m_pos_Issuer=m_children.begin();
259                 m_pos_Signature=m_pos_Issuer;
260                 ++m_pos_Signature;
261                 m_pos_Extensions=m_pos_Signature;
262                 ++m_pos_Extensions;
263             }
264         protected:
265             RequestImpl() {
266                 init();
267             }
268         public:
269             virtual ~RequestImpl() {
270                 XMLString::release(&m_ID);
271                 XMLString::release(&m_Version);
272                 XMLString::release(&m_Destination);
273                 XMLString::release(&m_Consent);
274                 delete m_IssueInstant;
275             }
276     
277             RequestImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
278                 : AbstractXMLObject(nsURI, localName, prefix, schemaType)
279             {
280                 init();
281             }
282                 
283             RequestImpl(const RequestImpl& src) : AbstractXMLObject(src), AbstractDOMCachingXMLObject(src) {
284                 init();
285                 setID(src.getID());
286                 setVersion(src.getVersion());
287                 setIssueInstant(src.getIssueInstant());
288                 setDestination(src.getDestination());
289                 setConsent(src.getConsent());
290                 if (src.getIssuer())
291                     setIssuer(src.getIssuer()->cloneIssuer());
292                 if (src.getSignature())
293                     setSignature(src.getSignature()->cloneSignature());
294                 if (src.getExtensions())
295                     setExtensions(src.getExtensions()->cloneExtensions());
296             }
297             
298             //IMPL_TYPED_CHILD(Signature);
299             // Need customized setter.
300         protected:
301             Signature* m_Signature;
302             list<XMLObject*>::iterator m_pos_Signature;
303         public:
304             Signature* getSignature() const {
305                 return m_Signature;
306             }
307             
308             void setSignature(Signature* sig) {
309                 prepareForAssignment(m_Signature,sig);
310                 *m_pos_Signature=m_Signature=sig;
311                 // Sync content reference back up.
312                 if (m_Signature)
313                     m_Signature->setContentReference(new opensaml::ContentReference(*this));
314             }
315             
316             IMPL_XMLOBJECT_CLONE(Request);
317             IMPL_STRING_ATTRIB(Version);
318             IMPL_ID_ATTRIB(ID);
319             IMPL_DATETIME_ATTRIB(IssueInstant,0);
320             IMPL_STRING_ATTRIB(Destination);
321             IMPL_STRING_ATTRIB(Consent);
322             IMPL_TYPED_FOREIGN_CHILD(Issuer,saml2);
323             IMPL_TYPED_CHILD(Extensions);
324     
325         protected:
326             void marshallAttributes(DOMElement* domElement) const {
327                 if (!m_Version)
328                     const_cast<RequestImpl*>(this)->m_Version=XMLString::transcode("2.0");
329                 MARSHALL_STRING_ATTRIB(Version,VER,NULL);
330                 if (!m_ID)
331                     const_cast<RequestImpl*>(this)->m_ID=SAMLConfig::getConfig().generateIdentifier();
332                 MARSHALL_ID_ATTRIB(ID,ID,NULL);
333                 if (!m_IssueInstant) {
334                     const_cast<RequestImpl*>(this)->m_IssueInstantEpoch=time(NULL);
335                     const_cast<RequestImpl*>(this)->m_IssueInstant=new DateTime(m_IssueInstantEpoch);
336                 }
337                 MARSHALL_DATETIME_ATTRIB(IssueInstant,ISSUEINSTANT,NULL);
338                 MARSHALL_STRING_ATTRIB(Destination,DESTINATION,NULL);
339                 MARSHALL_STRING_ATTRIB(Consent,CONSENT,NULL);
340             }
341     
342             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
343                 PROC_TYPED_FOREIGN_CHILD(Issuer,saml2,SAMLConstants::SAML20_NS,false);
344                 PROC_TYPED_FOREIGN_CHILD(Signature,xmlsignature,XMLConstants::XMLSIG_NS,false);
345                 PROC_TYPED_CHILD(Extensions,SAMLConstants::SAML20P_NS,false);
346                 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
347             }
348     
349             void processAttribute(const DOMAttr* attribute) {
350                 PROC_ID_ATTRIB(ID,ID,NULL);
351                 PROC_STRING_ATTRIB(Version,VER,NULL);
352                 PROC_DATETIME_ATTRIB(IssueInstant,ISSUEINSTANT,NULL);
353                 PROC_STRING_ATTRIB(Destination,DESTINATION,NULL);
354                 PROC_STRING_ATTRIB(Consent,CONSENT,NULL);
355                 AbstractXMLObjectUnmarshaller::processAttribute(attribute);
356             }
357         };
358
359
360         class SAML_DLLLOCAL AssertionIDRequestImpl : public virtual AssertionIDRequest, public RequestImpl
361         {
362         public:
363             virtual ~AssertionIDRequestImpl() { }
364     
365             AssertionIDRequestImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
366                 : AbstractXMLObject(nsURI, localName, prefix, schemaType) { }
367                 
368             AssertionIDRequestImpl(const AssertionIDRequestImpl& src) : AbstractXMLObject(src), RequestImpl(src) {
369                 VectorOf(AssertionIDRef) v=getAssertionIDRefs();
370                 for (vector<AssertionIDRef*>::const_iterator i=src.m_AssertionIDRefs.begin(); i!=src.m_AssertionIDRefs.end(); i++) {
371                     if (*i) {                               
372                         v.push_back((*i)->cloneAssertionIDRef());
373                     }
374                 }
375
376             }
377             
378             IMPL_XMLOBJECT_CLONE(AssertionIDRequest);
379             IMPL_TYPED_FOREIGN_CHILDREN(AssertionIDRef,saml2,m_children.end());
380     
381         protected:
382             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
383                 PROC_TYPED_FOREIGN_CHILDREN(AssertionIDRef,saml2,SAMLConstants::SAML20_NS,false);
384                 RequestImpl::processChildElement(childXMLObject,root);
385             }
386         };
387
388         class SAML_DLLLOCAL SubjectQueryImpl : public virtual SubjectQuery, public RequestImpl
389         {
390             void init()
391             {
392                 m_Subject = NULL;
393                 m_children.push_back(NULL);
394                 m_pos_Subject = m_pos_Extensions;
395                 ++m_pos_Subject;
396             }
397         protected:
398             SubjectQueryImpl() {
399                 init();
400             }
401         public:
402             virtual ~SubjectQueryImpl() { }
403     
404             SubjectQueryImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
405                 : AbstractXMLObject(nsURI, localName, prefix, schemaType)
406             { 
407                 init();
408             }
409                 
410             SubjectQueryImpl(const SubjectQueryImpl& src) : AbstractXMLObject(src), RequestImpl(src) {
411                 init();
412                 if (src.getSubject())
413                     setSubject(src.getSubject()->cloneSubject());
414             }
415             
416             IMPL_XMLOBJECT_CLONE(SubjectQuery);
417             IMPL_TYPED_FOREIGN_CHILD(Subject,saml2);
418     
419         protected:
420             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
421                 PROC_TYPED_FOREIGN_CHILD(Subject,saml2,SAMLConstants::SAML20_NS,false);
422                 RequestImpl::processChildElement(childXMLObject,root);
423             }
424         };
425
426
427         class SAML_DLLLOCAL RequestedAuthnContextImpl : public virtual RequestedAuthnContext,
428             public AbstractComplexElement,
429             public AbstractDOMCachingXMLObject,
430             public AbstractXMLObjectMarshaller,
431             public AbstractXMLObjectUnmarshaller
432         {
433             void init() {
434                 m_Comparison=NULL;
435             }
436         public:
437             virtual ~RequestedAuthnContextImpl() {
438                 XMLString::release(&m_Comparison);
439             }
440     
441             RequestedAuthnContextImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
442                 : AbstractXMLObject(nsURI, localName, prefix, schemaType)
443             {
444                 init();
445             }
446                 
447             RequestedAuthnContextImpl(const RequestedAuthnContextImpl& src) : AbstractXMLObject(src), AbstractDOMCachingXMLObject(src) {
448                 init();
449                 setComparison(src.getComparison());
450                 for (list<XMLObject*>::const_iterator i=src.m_children.begin(); i!=src.m_children.end(); i++) {
451                     if (*i) {
452                         AuthnContextClassRef* classref=dynamic_cast<AuthnContextClassRef*>(*i);
453                         if (classref) {
454                             getAuthnContextClassRefs().push_back(classref->cloneAuthnContextClassRef());
455                             continue;
456                         }
457
458                         AuthnContextDeclRef* declref=dynamic_cast<AuthnContextDeclRef*>(*i);
459                         if (declref) {
460                             getAuthnContextDeclRefs().push_back(declref->cloneAuthnContextDeclRef());
461                             continue;
462                         }
463                     }
464                 }
465             }
466             
467             IMPL_XMLOBJECT_CLONE(RequestedAuthnContext);
468             IMPL_STRING_ATTRIB(Comparison);
469             IMPL_TYPED_FOREIGN_CHILDREN(AuthnContextClassRef,saml2,m_children.end());
470             IMPL_TYPED_FOREIGN_CHILDREN(AuthnContextDeclRef,saml2,m_children.end());
471     
472         protected:
473             void marshallAttributes(DOMElement* domElement) const {
474                 MARSHALL_STRING_ATTRIB(Comparison,COMPARISON,NULL);
475             }
476     
477             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
478                 PROC_TYPED_FOREIGN_CHILDREN(AuthnContextClassRef,saml2,SAMLConstants::SAML20_NS,false);
479                 PROC_TYPED_FOREIGN_CHILDREN(AuthnContextDeclRef,saml2,SAMLConstants::SAML20_NS,false);
480                 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
481             }
482     
483             void processAttribute(const DOMAttr* attribute) {
484                 PROC_STRING_ATTRIB(Comparison,COMPARISON,NULL);
485                 AbstractXMLObjectUnmarshaller::processAttribute(attribute);
486             }
487         };
488
489
490         class SAML_DLLLOCAL AuthnQueryImpl : public virtual AuthnQuery, public SubjectQueryImpl
491         {
492             void init() {
493                 m_SessionIndex=NULL;
494                 m_RequestedAuthnContext=NULL;
495                 m_children.push_back(NULL);
496                 m_pos_RequestedAuthnContext = m_pos_Subject;
497                 ++m_pos_RequestedAuthnContext;
498                 
499             }
500         public:
501             virtual ~AuthnQueryImpl() {
502                 XMLString::release(&m_SessionIndex);
503             }
504     
505             AuthnQueryImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
506                 : AbstractXMLObject(nsURI, localName, prefix, schemaType)
507             {
508                 init();
509             }
510                 
511             AuthnQueryImpl(const AuthnQueryImpl& src) : AbstractXMLObject(src), SubjectQueryImpl(src) {
512                 init();
513                 setSessionIndex(src.getSessionIndex());
514                 if (src.getRequestedAuthnContext())
515                     setRequestedAuthnContext(src.getRequestedAuthnContext()->cloneRequestedAuthnContext());
516             }
517             
518             IMPL_XMLOBJECT_CLONE(AuthnQuery);
519             IMPL_STRING_ATTRIB(SessionIndex);
520             IMPL_TYPED_CHILD(RequestedAuthnContext);
521     
522         protected:
523             void marshallAttributes(DOMElement* domElement) const {
524                 MARSHALL_STRING_ATTRIB(SessionIndex,SESSIONINDEX,NULL);
525                 SubjectQueryImpl::marshallAttributes(domElement);
526             }
527     
528             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
529                 PROC_TYPED_CHILD(RequestedAuthnContext,SAMLConstants::SAML20P_NS,false);
530                 SubjectQueryImpl::processChildElement(childXMLObject,root);
531             }
532             void processAttribute(const DOMAttr* attribute) {
533                 PROC_STRING_ATTRIB(SessionIndex,SESSIONINDEX,NULL);
534                 SubjectQueryImpl::processAttribute(attribute);
535             }
536         };
537
538         class SAML_DLLLOCAL AttributeQueryImpl : public virtual AttributeQuery, public SubjectQueryImpl
539         {
540         public:
541             virtual ~AttributeQueryImpl() { }
542     
543             AttributeQueryImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
544                 : AbstractXMLObject(nsURI, localName, prefix, schemaType) { }
545                 
546             AttributeQueryImpl(const AttributeQueryImpl& src) : AbstractXMLObject(src), SubjectQueryImpl(src) {
547                 for (list<XMLObject*>::const_iterator i=src.m_children.begin(); i!=src.m_children.end(); i++) {
548                     if (*i) {
549                         Attribute* attrib=dynamic_cast<Attribute*>(*i);
550                         if (attrib) {
551                             getAttributes().push_back(attrib->cloneAttribute());
552                             continue;
553                         }
554                     }
555                 }
556
557             }
558             
559             IMPL_XMLOBJECT_CLONE(AttributeQuery);
560             IMPL_TYPED_FOREIGN_CHILDREN(Attribute,saml2,m_children.end());
561     
562         protected:
563             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
564                 PROC_TYPED_FOREIGN_CHILDREN(Attribute,saml2,SAMLConstants::SAML20_NS,false);
565                 SubjectQueryImpl::processChildElement(childXMLObject,root);
566             }
567         };
568
569         class SAML_DLLLOCAL AuthzDecisionQueryImpl : public virtual AuthzDecisionQuery, public SubjectQueryImpl
570         {
571             void init() {
572                 m_Resource=NULL;
573                 m_Evidence=NULL;
574                 m_children.push_back(NULL);
575                 m_pos_Evidence=m_pos_Subject;
576                 ++m_pos_Evidence;
577                 
578             }
579         public:
580             virtual ~AuthzDecisionQueryImpl() {
581                 XMLString::release(&m_Resource);
582             }
583     
584             AuthzDecisionQueryImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
585                 : AbstractXMLObject(nsURI, localName, prefix, schemaType)
586             {
587                 init();
588             }
589                 
590             AuthzDecisionQueryImpl(const AuthzDecisionQueryImpl& src) : AbstractXMLObject(src), SubjectQueryImpl(src) {
591                 init();
592                 setResource(src.getResource());
593                 if (src.getEvidence())
594                     setEvidence(src.getEvidence()->cloneEvidence());
595                 for (list<XMLObject*>::const_iterator i=src.m_children.begin(); i!=src.m_children.end(); i++) {
596                     if (*i) {
597                         Action* action=dynamic_cast<Action*>(*i);
598                         if (action) {
599                             getActions().push_back(action->cloneAction());
600                             continue;
601                         }
602                     }
603                 }
604             }
605             
606             IMPL_XMLOBJECT_CLONE(AuthzDecisionQuery);
607             IMPL_STRING_ATTRIB(Resource);
608             IMPL_TYPED_FOREIGN_CHILDREN(Action,saml2,m_pos_Evidence);
609             IMPL_TYPED_FOREIGN_CHILD(Evidence,saml2);
610     
611         protected:
612             void marshallAttributes(DOMElement* domElement) const {
613                 MARSHALL_STRING_ATTRIB(Resource,RESOURCE,NULL);
614                 SubjectQueryImpl::marshallAttributes(domElement);
615             }
616     
617             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
618                 PROC_TYPED_FOREIGN_CHILD(Evidence,saml2,SAMLConstants::SAML20_NS,false);
619                 PROC_TYPED_FOREIGN_CHILDREN(Action,saml2,SAMLConstants::SAML20_NS,false);
620                 SubjectQueryImpl::processChildElement(childXMLObject,root);
621             }
622             void processAttribute(const DOMAttr* attribute) {
623                 PROC_STRING_ATTRIB(Resource,RESOURCE,NULL);
624                 SubjectQueryImpl::processAttribute(attribute);
625             }
626         };
627
628         class SAML_DLLLOCAL NameIDPolicyImpl : public virtual NameIDPolicy,
629             public AbstractChildlessElement,
630             public AbstractDOMCachingXMLObject,
631             public AbstractXMLObjectMarshaller,
632             public AbstractXMLObjectUnmarshaller
633         {
634             void init() {
635                 m_Format=NULL;
636                 m_SPNameQualifier=NULL;
637                 m_AllowCreate=XMLConstants::XML_BOOL_NULL;
638             }
639             public:
640                 virtual ~NameIDPolicyImpl()
641                 {
642                     XMLString::release(&m_Format);
643                     XMLString::release(&m_SPNameQualifier);
644                 }
645
646                 NameIDPolicyImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
647                     : AbstractXMLObject(nsURI, localName, prefix, schemaType)
648                 {
649                         init();
650                 }
651
652                 NameIDPolicyImpl(const NameIDPolicyImpl& src) : AbstractXMLObject(src), AbstractDOMCachingXMLObject(src) {
653                     init();
654                     setFormat(src.getFormat());
655                     setSPNameQualifier(src.getSPNameQualifier());
656                     AllowCreate(m_AllowCreate);
657                 }
658
659                 IMPL_XMLOBJECT_CLONE(NameIDPolicy);
660                 IMPL_STRING_ATTRIB(Format);
661                 IMPL_STRING_ATTRIB(SPNameQualifier);
662                 IMPL_BOOLEAN_ATTRIB(AllowCreate);
663
664             protected:
665                 void marshallAttributes(DOMElement* domElement) const {
666                     MARSHALL_STRING_ATTRIB(Format,FORMAT,NULL);
667                     MARSHALL_STRING_ATTRIB(SPNameQualifier,SPNAMEQUALIFIER,NULL);
668                     MARSHALL_BOOLEAN_ATTRIB(AllowCreate,ALLOWCREATE,NULL);
669                 }
670
671                 void processAttribute(const DOMAttr* attribute) {
672                     PROC_STRING_ATTRIB(Format,FORMAT,NULL);
673                     PROC_STRING_ATTRIB(SPNameQualifier,SPNAMEQUALIFIER,NULL);
674                     PROC_BOOLEAN_ATTRIB(AllowCreate,ALLOWCREATE,NULL);
675                     AbstractXMLObjectUnmarshaller::processAttribute(attribute);
676                 }
677         };
678
679         class SAML_DLLLOCAL IDPEntryImpl : public virtual IDPEntry,
680             public AbstractChildlessElement,
681             public AbstractDOMCachingXMLObject,
682             public AbstractXMLObjectMarshaller,
683             public AbstractXMLObjectUnmarshaller
684         {
685             void init() {
686                 m_ProviderID=NULL;
687                 m_Name=NULL;
688                 m_Loc=NULL;
689             }
690             public:
691                 virtual ~IDPEntryImpl()
692                 {
693                     XMLString::release(&m_ProviderID);
694                     XMLString::release(&m_Name);
695                     XMLString::release(&m_Loc);
696                 }
697
698                 IDPEntryImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
699                     : AbstractXMLObject(nsURI, localName, prefix, schemaType)
700                 {
701                         init();
702                 }
703
704                 IDPEntryImpl(const IDPEntryImpl& src) : AbstractXMLObject(src), AbstractDOMCachingXMLObject(src) {
705                     init();
706                     setProviderID(src.getProviderID());
707                     setName(src.getName());
708                     setLoc(src.getLoc());
709                 }
710
711                 IMPL_XMLOBJECT_CLONE(IDPEntry);
712                 IMPL_STRING_ATTRIB(ProviderID);
713                 IMPL_STRING_ATTRIB(Name);
714                 IMPL_STRING_ATTRIB(Loc);
715
716             protected:
717                 void marshallAttributes(DOMElement* domElement) const {
718                     MARSHALL_STRING_ATTRIB(ProviderID,PROVIDERID,NULL);
719                     MARSHALL_STRING_ATTRIB(Name,NAME,NULL);
720                     MARSHALL_STRING_ATTRIB(Loc,LOC,NULL);
721                 }
722
723                 void processAttribute(const DOMAttr* attribute) {
724                     PROC_STRING_ATTRIB(ProviderID,PROVIDERID,NULL);
725                     PROC_STRING_ATTRIB(Name,NAME,NULL);
726                     PROC_STRING_ATTRIB(Loc,LOC,NULL);
727                     AbstractXMLObjectUnmarshaller::processAttribute(attribute);
728                 }
729         };
730
731         class SAML_DLLLOCAL IDPListImpl : public virtual IDPList,
732             public AbstractComplexElement,
733             public AbstractDOMCachingXMLObject,
734             public AbstractXMLObjectMarshaller,
735             public AbstractXMLObjectUnmarshaller
736         {
737             void init() {
738                 m_GetComplete=NULL;
739                 m_children.push_back(NULL);
740                 m_pos_GetComplete=m_children.begin();
741                 
742             }
743         public:
744             virtual ~IDPListImpl() { }
745     
746             IDPListImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
747                 : AbstractXMLObject(nsURI, localName, prefix, schemaType)
748             {
749                 init();
750             }
751                 
752             IDPListImpl(const IDPListImpl& src)
753                     : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
754                 init();
755                 if (src.getGetComplete())
756                     setGetComplete(src.getGetComplete()->cloneGetComplete());
757                 for (list<XMLObject*>::const_iterator i=src.m_children.begin(); i!=src.m_children.end(); i++) {
758                     if (*i) {
759                         IDPEntry* entry=dynamic_cast<IDPEntry*>(*i);
760                         if (entry) {
761                             getIDPEntrys().push_back(entry->cloneIDPEntry());
762                             continue;
763                         }
764                     }
765                 }
766             }
767             
768             IMPL_XMLOBJECT_CLONE(IDPList);
769             IMPL_TYPED_CHILDREN(IDPEntry,m_pos_GetComplete);
770             IMPL_TYPED_CHILD(GetComplete);
771     
772         protected:
773             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
774                 PROC_TYPED_CHILDREN(IDPEntry,SAMLConstants::SAML20P_NS,false);
775                 PROC_TYPED_CHILD(GetComplete,SAMLConstants::SAML20P_NS,false);
776                 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
777             }
778         };
779
780
781         class SAML_DLLLOCAL ScopingImpl : public virtual Scoping,
782             public AbstractComplexElement,
783             public AbstractDOMCachingXMLObject,
784             public AbstractXMLObjectMarshaller,
785             public AbstractXMLObjectUnmarshaller
786         {
787             void init() {
788                 m_ProxyCount=NULL;
789                 m_IDPList=NULL;
790                 m_children.push_back(NULL);
791                 m_pos_IDPList=m_children.begin();
792                 
793             }
794         public:
795             virtual ~ScopingImpl() {
796                 XMLString::release(&m_ProxyCount); 
797             }
798     
799             ScopingImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
800                 : AbstractXMLObject(nsURI, localName, prefix, schemaType)
801             {
802                 init();
803             }
804                 
805             ScopingImpl(const ScopingImpl& src)
806                     : AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
807                 init();
808                 setProxyCount(m_ProxyCount);
809                 if (src.getIDPList())
810                     setIDPList(src.getIDPList()->cloneIDPList());
811                 for (list<XMLObject*>::const_iterator i=src.m_children.begin(); i!=src.m_children.end(); i++) {
812                     if (*i) {
813                         RequesterID* reqid =dynamic_cast<RequesterID*>(*i);
814                         if (reqid) {
815                             getRequesterIDs().push_back(reqid->cloneRequesterID());
816                             continue;
817                         }
818                     }
819                 }
820             }
821             
822             IMPL_XMLOBJECT_CLONE(Scoping);
823             IMPL_INTEGER_ATTRIB(ProxyCount);
824             IMPL_TYPED_CHILD(IDPList);
825             IMPL_TYPED_CHILDREN(RequesterID,m_children.end());
826     
827         protected:
828             void marshallAttributes(DOMElement* domElement) const {
829                     MARSHALL_INTEGER_ATTRIB(ProxyCount,PROXYCOUNT,NULL);
830             }
831     
832             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
833                 PROC_TYPED_CHILD(IDPList,SAMLConstants::SAML20P_NS,false);
834                 PROC_TYPED_CHILDREN(RequesterID,SAMLConstants::SAML20P_NS,false);
835                 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
836             }
837
838             void processAttribute(const DOMAttr* attribute) {
839                 PROC_INTEGER_ATTRIB(ProxyCount,PROXYCOUNT,NULL);
840                 AbstractXMLObjectUnmarshaller::processAttribute(attribute);
841             }
842         };
843
844         class SAML_DLLLOCAL AuthnRequestImpl : public virtual AuthnRequest, public RequestImpl
845         {
846             void init() {
847                 m_ForceAuthn=XMLConstants::XML_BOOL_NULL;
848                 m_IsPassive=XMLConstants::XML_BOOL_NULL;
849                 m_ProtocolBinding=NULL;
850                 m_AssertionConsumerServiceIndex=NULL;
851                 m_AssertionConsumerServiceURL=NULL;
852                 m_AttributeConsumingServiceIndex=NULL;
853                 m_ProviderName=NULL;
854
855                 m_Subject=NULL;
856                 m_NameIDPolicy=NULL;
857                 m_Conditions=NULL;
858                 m_RequestedAuthnContext=NULL;
859                 m_Scoping=NULL;
860                 m_children.push_back(NULL);
861                 m_children.push_back(NULL);
862                 m_children.push_back(NULL);
863                 m_children.push_back(NULL);
864                 m_children.push_back(NULL);
865                 m_pos_Subject=m_pos_Extensions;
866                 ++m_pos_Subject;
867                 m_pos_NameIDPolicy=m_pos_Subject;
868                 ++m_pos_NameIDPolicy;
869                 m_pos_Conditions=m_pos_NameIDPolicy;
870                 ++m_pos_Conditions;
871                 m_pos_RequestedAuthnContext=m_pos_Conditions;
872                 ++m_pos_RequestedAuthnContext;
873                 m_pos_Scoping=m_pos_RequestedAuthnContext;
874                 ++m_pos_Scoping;
875                 
876             }
877         public:
878             virtual ~AuthnRequestImpl() {
879                 XMLString::release(&m_ProtocolBinding);
880                 XMLString::release(&m_AssertionConsumerServiceURL);
881                 XMLString::release(&m_ProviderName);
882                 XMLString::release(&m_AssertionConsumerServiceIndex);
883                 XMLString::release(&m_AttributeConsumingServiceIndex);
884             }
885     
886             AuthnRequestImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
887                 : AbstractXMLObject(nsURI, localName, prefix, schemaType)
888             {
889                 init();
890             }
891                 
892             AuthnRequestImpl(const AuthnRequestImpl& src) : AbstractXMLObject(src), RequestImpl(src) {
893                 init();
894
895                 ForceAuthn(m_ForceAuthn);
896                 IsPassive(m_IsPassive);
897                 setProtocolBinding(src.getProtocolBinding());
898                 setAssertionConsumerServiceIndex(m_AssertionConsumerServiceIndex);
899                 setAssertionConsumerServiceURL(src.getAssertionConsumerServiceURL());
900                 setAttributeConsumingServiceIndex(m_AttributeConsumingServiceIndex);
901                 setProviderName(src.getProviderName());
902
903                 if (src.getSubject())
904                     setSubject(src.getSubject()->cloneSubject());
905                 if (src.getNameIDPolicy())
906                     setNameIDPolicy(src.getNameIDPolicy()->cloneNameIDPolicy());
907                 if (src.getConditions())
908                     setConditions(src.getConditions()->cloneConditions());
909                 if (src.getRequestedAuthnContext())
910                     setRequestedAuthnContext(src.getRequestedAuthnContext()->cloneRequestedAuthnContext());
911                 if (src.getScoping())
912                     setScoping(src.getScoping()->cloneScoping());
913             }
914             
915             IMPL_XMLOBJECT_CLONE(AuthnRequest);
916
917             IMPL_BOOLEAN_ATTRIB(ForceAuthn);
918             IMPL_BOOLEAN_ATTRIB(IsPassive);
919             IMPL_STRING_ATTRIB(ProtocolBinding);
920             IMPL_INTEGER_ATTRIB(AssertionConsumerServiceIndex);
921             IMPL_STRING_ATTRIB(AssertionConsumerServiceURL);
922             IMPL_INTEGER_ATTRIB(AttributeConsumingServiceIndex);
923             IMPL_STRING_ATTRIB(ProviderName);
924
925             IMPL_TYPED_FOREIGN_CHILD(Subject,saml2);
926             IMPL_TYPED_CHILD(NameIDPolicy);
927             IMPL_TYPED_FOREIGN_CHILD(Conditions,saml2);
928             IMPL_TYPED_CHILD(RequestedAuthnContext);
929             IMPL_TYPED_CHILD(Scoping);
930     
931         protected:
932             void marshallAttributes(DOMElement* domElement) const {
933                 MARSHALL_BOOLEAN_ATTRIB(ForceAuthn,FORCEAUTHN,NULL);
934                 MARSHALL_BOOLEAN_ATTRIB(IsPassive,ISPASSIVE,NULL);
935                 MARSHALL_STRING_ATTRIB(ProtocolBinding,PROTOCOLBINDING,NULL);
936                 MARSHALL_INTEGER_ATTRIB(AssertionConsumerServiceIndex,ASSERTIONCONSUMERSERVICEINDEX,NULL);
937                 MARSHALL_STRING_ATTRIB(AssertionConsumerServiceURL,ASSERTIONCONSUMERSERVICEURL,NULL);
938                 MARSHALL_INTEGER_ATTRIB(AttributeConsumingServiceIndex,ATTRIBUTECONSUMINGSERVICEINDEX,NULL);
939                 MARSHALL_STRING_ATTRIB(ProviderName,PROVIDERNAME,NULL);
940                 RequestImpl::marshallAttributes(domElement);
941             }
942     
943             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
944                 PROC_TYPED_FOREIGN_CHILD(Subject,saml2,SAMLConstants::SAML20_NS,false);
945                 PROC_TYPED_CHILD(NameIDPolicy,SAMLConstants::SAML20P_NS,false);
946                 PROC_TYPED_FOREIGN_CHILD(Conditions,saml2,SAMLConstants::SAML20_NS,false);
947                 PROC_TYPED_CHILD(RequestedAuthnContext,SAMLConstants::SAML20P_NS,false);
948                 PROC_TYPED_CHILD(Scoping,SAMLConstants::SAML20P_NS,false);
949                 RequestImpl::processChildElement(childXMLObject,root);
950             }
951             void processAttribute(const DOMAttr* attribute) {
952                 PROC_BOOLEAN_ATTRIB(ForceAuthn,FORCEAUTHN,NULL);
953                 PROC_BOOLEAN_ATTRIB(IsPassive,ISPASSIVE,NULL);
954                 PROC_STRING_ATTRIB(ProtocolBinding,PROTOCOLBINDING,NULL);
955                 PROC_INTEGER_ATTRIB(AssertionConsumerServiceIndex,ASSERTIONCONSUMERSERVICEINDEX,NULL);
956                 PROC_STRING_ATTRIB(AssertionConsumerServiceURL,ASSERTIONCONSUMERSERVICEURL,NULL);
957                 PROC_INTEGER_ATTRIB(AttributeConsumingServiceIndex,ATTRIBUTECONSUMINGSERVICEINDEX,NULL);
958                 PROC_STRING_ATTRIB(ProviderName,PROVIDERNAME,NULL);
959                 RequestImpl::processAttribute(attribute);
960             }
961         };
962
963         class SAML_DLLLOCAL StatusResponseImpl : public virtual StatusResponse,
964             public AbstractComplexElement,
965             public AbstractDOMCachingXMLObject,
966             public AbstractXMLObjectMarshaller,
967             public AbstractXMLObjectUnmarshaller
968         {
969             void init() {
970                 m_ID=NULL;
971                 m_InResponseTo=NULL;
972                 m_Version=NULL;
973                 m_IssueInstant=NULL;
974                 m_Destination=NULL;
975                 m_Consent=NULL;
976                 m_Issuer=NULL;
977                 m_Signature=NULL;
978                 m_Extensions=NULL;
979                 m_Status=NULL;
980                 m_children.push_back(NULL);
981                 m_children.push_back(NULL);
982                 m_children.push_back(NULL);
983                 m_children.push_back(NULL);
984                 m_pos_Issuer=m_children.begin();
985                 m_pos_Signature=m_pos_Issuer;
986                 ++m_pos_Signature;
987                 m_pos_Extensions=m_pos_Signature;
988                 ++m_pos_Extensions;
989                 m_pos_Status=m_pos_Extensions;
990                 ++m_pos_Status;
991             }
992         protected:
993             StatusResponseImpl() {
994                 init();
995             }
996         public:
997             virtual ~StatusResponseImpl() {
998                 XMLString::release(&m_ID);
999                 XMLString::release(&m_InResponseTo);
1000                 XMLString::release(&m_Version);
1001                 XMLString::release(&m_Destination);
1002                 XMLString::release(&m_Consent);
1003                 delete m_IssueInstant;
1004             }
1005     
1006             StatusResponseImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
1007                 : AbstractXMLObject(nsURI, localName, prefix, schemaType)
1008             {
1009                 init();
1010             }
1011                 
1012             StatusResponseImpl(const StatusResponseImpl& src) : AbstractXMLObject(src), AbstractDOMCachingXMLObject(src) {
1013                 init();
1014                 setID(src.getID());
1015                 setInResponseTo(src.getInResponseTo());
1016                 setVersion(src.getVersion());
1017                 setIssueInstant(src.getIssueInstant());
1018                 setDestination(src.getDestination());
1019                 setConsent(src.getConsent());
1020                 if (src.getIssuer())
1021                     setIssuer(src.getIssuer()->cloneIssuer());
1022                 if (src.getSignature())
1023                     setSignature(src.getSignature()->cloneSignature());
1024                 if (src.getExtensions())
1025                     setExtensions(src.getExtensions()->cloneExtensions());
1026                 if (src.getStatus())
1027                     setStatus(src.getStatus()->cloneStatus());
1028             }
1029             
1030             //IMPL_TYPED_CHILD(Signature);
1031             // Need customized setter.
1032         protected:
1033             Signature* m_Signature;
1034             list<XMLObject*>::iterator m_pos_Signature;
1035         public:
1036             Signature* getSignature() const {
1037                 return m_Signature;
1038             }
1039             
1040             void setSignature(Signature* sig) {
1041                 prepareForAssignment(m_Signature,sig);
1042                 *m_pos_Signature=m_Signature=sig;
1043                 // Sync content reference back up.
1044                 if (m_Signature)
1045                     m_Signature->setContentReference(new opensaml::ContentReference(*this));
1046             }
1047             
1048             IMPL_XMLOBJECT_CLONE(StatusResponse);
1049             IMPL_STRING_ATTRIB(Version);
1050             IMPL_ID_ATTRIB(ID);
1051             IMPL_STRING_ATTRIB(InResponseTo);
1052             IMPL_DATETIME_ATTRIB(IssueInstant,0);
1053             IMPL_STRING_ATTRIB(Destination);
1054             IMPL_STRING_ATTRIB(Consent);
1055             IMPL_TYPED_FOREIGN_CHILD(Issuer,saml2);
1056             IMPL_TYPED_CHILD(Extensions);
1057             IMPL_TYPED_CHILD(Status);
1058     
1059         protected:
1060             void marshallAttributes(DOMElement* domElement) const {
1061                 if (!m_Version)
1062                     const_cast<StatusResponseImpl*>(this)->m_Version=XMLString::transcode("2.0");
1063                 MARSHALL_STRING_ATTRIB(Version,VER,NULL);
1064                 if (!m_ID)
1065                     const_cast<StatusResponseImpl*>(this)->m_ID=SAMLConfig::getConfig().generateIdentifier();
1066                 MARSHALL_ID_ATTRIB(ID,ID,NULL);
1067                 if (!m_IssueInstant) {
1068                     const_cast<StatusResponseImpl*>(this)->m_IssueInstantEpoch=time(NULL);
1069                     const_cast<StatusResponseImpl*>(this)->m_IssueInstant=new DateTime(m_IssueInstantEpoch);
1070                 }
1071                 MARSHALL_DATETIME_ATTRIB(IssueInstant,ISSUEINSTANT,NULL);
1072                 MARSHALL_STRING_ATTRIB(Destination,DESTINATION,NULL);
1073                 MARSHALL_STRING_ATTRIB(Consent,CONSENT,NULL);
1074                 MARSHALL_STRING_ATTRIB(InResponseTo,INRESPONSETO,NULL);
1075             }
1076     
1077             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
1078                 PROC_TYPED_FOREIGN_CHILD(Issuer,saml2,SAMLConstants::SAML20_NS,false);
1079                 PROC_TYPED_FOREIGN_CHILD(Signature,xmlsignature,XMLConstants::XMLSIG_NS,false);
1080                 PROC_TYPED_CHILD(Extensions,SAMLConstants::SAML20P_NS,false);
1081                 PROC_TYPED_CHILD(Status,SAMLConstants::SAML20P_NS,false);
1082                 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
1083             }
1084     
1085             void processAttribute(const DOMAttr* attribute) {
1086                 PROC_ID_ATTRIB(ID,ID,NULL);
1087                 PROC_STRING_ATTRIB(Version,VER,NULL);
1088                 PROC_STRING_ATTRIB(InResponseTo,INRESPONSETO,NULL);
1089                 PROC_DATETIME_ATTRIB(IssueInstant,ISSUEINSTANT,NULL);
1090                 PROC_STRING_ATTRIB(Destination,DESTINATION,NULL);
1091                 PROC_STRING_ATTRIB(Consent,CONSENT,NULL);
1092                 AbstractXMLObjectUnmarshaller::processAttribute(attribute);
1093             }
1094         };
1095
1096         class SAML_DLLLOCAL ResponseImpl : public virtual Response, public StatusResponseImpl
1097         {
1098         public:
1099             virtual ~ResponseImpl() { }
1100     
1101             ResponseImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
1102                 : AbstractXMLObject(nsURI, localName, prefix, schemaType) { }
1103                 
1104             ResponseImpl(const ResponseImpl& src) : AbstractXMLObject(src), StatusResponseImpl(src) {
1105                 for (list<XMLObject*>::const_iterator i=src.m_children.begin(); i!=src.m_children.end(); i++) {
1106                     if (*i) {
1107                         Assertion* assertion=dynamic_cast<Assertion*>(*i);
1108                         if (assertion) {
1109                             getAssertions().push_back(assertion->cloneAssertion());
1110                             continue;
1111                         }
1112                         EncryptedAssertion* encAssertion=dynamic_cast<EncryptedAssertion*>(*i);
1113                         if (encAssertion) {
1114                             getEncryptedAssertions().push_back(encAssertion->cloneEncryptedAssertion());
1115                             continue;
1116                         }
1117                     }
1118                 }
1119
1120             }
1121             
1122             IMPL_XMLOBJECT_CLONE(Response);
1123             IMPL_TYPED_FOREIGN_CHILDREN(Assertion,saml2,m_children.end());
1124             IMPL_TYPED_FOREIGN_CHILDREN(EncryptedAssertion,saml2,m_children.end());
1125     
1126         protected:
1127             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
1128                 PROC_TYPED_FOREIGN_CHILDREN(Assertion,saml2,SAMLConstants::SAML20_NS,false);
1129                 PROC_TYPED_FOREIGN_CHILDREN(EncryptedAssertion,saml2,SAMLConstants::SAML20_NS,false);
1130                 StatusResponseImpl::processChildElement(childXMLObject,root);
1131             }
1132         };
1133
1134         class SAML_DLLLOCAL ArtifactResolveImpl : public virtual ArtifactResolve, public RequestImpl
1135         {
1136             void init() {
1137                 m_Artifact=NULL;
1138                 m_children.push_back(NULL);
1139                 m_pos_Artifact=m_pos_Extensions;
1140                 ++m_pos_Artifact;
1141             }
1142         public:
1143             virtual ~ArtifactResolveImpl() { }
1144     
1145             ArtifactResolveImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
1146                 : AbstractXMLObject(nsURI, localName, prefix, schemaType)
1147             { 
1148                 init();
1149             }
1150                 
1151             ArtifactResolveImpl(const ArtifactResolveImpl& src) : AbstractXMLObject(src), RequestImpl(src) {
1152                 init();
1153                 if(src.getArtifact())
1154                     setArtifact(src.getArtifact()->cloneArtifact());
1155             }
1156             
1157             IMPL_XMLOBJECT_CLONE(ArtifactResolve);
1158             IMPL_TYPED_CHILD(Artifact);
1159     
1160         protected:
1161             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
1162                 PROC_TYPED_CHILD(Artifact,SAMLConstants::SAML20P_NS,false);
1163                 RequestImpl::processChildElement(childXMLObject,root);
1164             }
1165         };
1166
1167         class SAML_DLLLOCAL ArtifactResponseImpl : public virtual ArtifactResponse, public StatusResponseImpl
1168         {
1169             void init() {
1170                 m_Payload=NULL;
1171                 m_children.push_back(NULL);
1172                 m_pos_Payload=m_pos_Status;
1173                 ++m_pos_Payload;
1174             }
1175         public:
1176             virtual ~ArtifactResponseImpl() { }
1177     
1178             ArtifactResponseImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
1179                 : AbstractXMLObject(nsURI, localName, prefix, schemaType)
1180             {
1181                 init();
1182             }
1183                 
1184             ArtifactResponseImpl(const ArtifactResponseImpl& src) : AbstractXMLObject(src), StatusResponseImpl(src) {
1185                 init();
1186                 if (src.getPayload())
1187                     setPayload(getPayload()->clone());
1188
1189             }
1190             
1191             IMPL_XMLOBJECT_CLONE(ArtifactResponse);
1192             IMPL_XMLOBJECT_CHILD(Payload);
1193     
1194         protected:
1195             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
1196                 // These are valid elements for the parent StatusResponse, so don't process these.
1197                 // If not one of these, then it must be the payload.
1198                 if (
1199                     ! XMLHelper::isNodeNamed(root,SAMLConstants::SAML20_NS,saml2::Issuer::LOCAL_NAME) &&
1200                     ! XMLHelper::isNodeNamed(root,XMLConstants::XMLSIG_NS,xmlsignature::Signature::LOCAL_NAME) &&
1201                     ! XMLHelper::isNodeNamed(root,SAMLConstants::SAML20P_NS,saml2p::Extensions::LOCAL_NAME) &&
1202                     ! XMLHelper::isNodeNamed(root,SAMLConstants::SAML20P_NS,saml2p::Status::LOCAL_NAME)
1203                    )
1204                 {
1205                     setPayload(childXMLObject);
1206                     return;
1207                 }
1208
1209                 StatusResponseImpl::processChildElement(childXMLObject,root);
1210             }
1211         };
1212
1213         class SAML_DLLLOCAL NewEncryptedIDImpl : public virtual NewEncryptedID,
1214             public AbstractComplexElement,
1215             public AbstractDOMCachingXMLObject,
1216             public AbstractXMLObjectMarshaller,
1217             public AbstractXMLObjectUnmarshaller
1218         {
1219             void init() {
1220                 m_EncryptedData=NULL;
1221                 m_children.push_back(NULL);
1222                 m_pos_EncryptedData=m_children.begin();
1223             }
1224             
1225         protected:
1226             NewEncryptedIDImpl()
1227             {
1228                 init();
1229             }
1230             
1231         public:
1232             virtual ~NewEncryptedIDImpl() {}
1233     
1234             NewEncryptedIDImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
1235                     : AbstractXMLObject(nsURI, localName, prefix, schemaType)
1236             {
1237                 init();
1238             }
1239                 
1240             NewEncryptedIDImpl(const NewEncryptedIDImpl& src) : AbstractXMLObject(src), AbstractDOMCachingXMLObject(src) {
1241                 init();
1242                 if (src.getEncryptedData())
1243                     setEncryptedData(src.getEncryptedData()->cloneEncryptedData());
1244                 VectorOf(xmlencryption::EncryptedKey) v=getEncryptedKeys();
1245                 for (vector<xmlencryption::EncryptedKey*>::const_iterator i=src.m_EncryptedKeys.begin(); i!=src.m_EncryptedKeys.end(); i++) {
1246                     if (*i) {
1247                         v.push_back((*i)->cloneEncryptedKey());
1248                     }
1249                 }
1250             }
1251     
1252             XMLObject* decrypt(KeyResolver* KEKresolver, const XMLCh* recipient) const
1253             {
1254                 if (!m_EncryptedData)
1255                     throw DecryptionException("No encrypted data present.");
1256                 Decrypter decrypter(KEKresolver, new EncryptedKeyResolver(*this, recipient));
1257                 DOMDocumentFragment* frag = decrypter.decryptData(m_EncryptedData);
1258                 if (frag->hasChildNodes() && frag->getFirstChild()==frag->getLastChild()) {
1259                     DOMNode* plaintext=frag->getFirstChild();
1260                     if (plaintext->getNodeType()==DOMNode::ELEMENT_NODE) {
1261                         auto_ptr<XMLObject> ret(XMLObjectBuilder::buildOneFromElement(static_cast<DOMElement*>(plaintext)));
1262                         ret->releaseThisAndChildrenDOM();
1263                         return ret.release();
1264                     }
1265                 }
1266                 frag->release();
1267                 throw DecryptionException("Decryption did not result in a single element.");
1268             }
1269         
1270             IMPL_XMLOBJECT_CLONE(NewEncryptedID);
1271             EncryptedElementType* cloneEncryptedElementType() const {
1272                 return new NewEncryptedIDImpl(*this);
1273             }
1274
1275             IMPL_TYPED_FOREIGN_CHILD(EncryptedData,xmlencryption);
1276             IMPL_TYPED_FOREIGN_CHILDREN(EncryptedKey,xmlencryption,m_children.end());
1277     
1278         protected:
1279             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
1280                 PROC_TYPED_FOREIGN_CHILD(EncryptedData,xmlencryption,XMLConstants::XMLENC_NS,false);
1281                 PROC_TYPED_FOREIGN_CHILDREN(EncryptedKey,xmlencryption,XMLConstants::XMLENC_NS,false);
1282                 AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
1283             }
1284         };
1285
1286         class SAML_DLLLOCAL TerminateImpl : public virtual Terminate,
1287             public AbstractChildlessElement,
1288             public AbstractDOMCachingXMLObject,
1289             public AbstractXMLObjectMarshaller,
1290             public AbstractXMLObjectUnmarshaller
1291         {
1292             public:
1293                 virtual ~TerminateImpl() { }
1294
1295                 TerminateImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
1296                     : AbstractXMLObject(nsURI, localName, prefix, schemaType) { }
1297
1298                 TerminateImpl(const TerminateImpl& src) : AbstractXMLObject(src), AbstractDOMCachingXMLObject(src) {
1299                 }
1300
1301                 IMPL_XMLOBJECT_CLONE(Terminate);
1302
1303             protected:
1304                 // has no attributes or children
1305         };
1306
1307         class SAML_DLLLOCAL ManageNameIDRequestImpl : public virtual ManageNameIDRequest, public RequestImpl
1308         {
1309             void init() {
1310                 m_NameID=NULL;
1311                 m_EncryptedID=NULL;
1312                 m_NewID=NULL;
1313                 m_NewEncryptedID=NULL;
1314                 m_Terminate=NULL;
1315                 m_children.push_back(NULL);
1316                 m_children.push_back(NULL);
1317                 m_children.push_back(NULL);
1318                 m_children.push_back(NULL);
1319                 m_children.push_back(NULL);
1320                 m_pos_NameID=m_pos_Extensions;
1321                 ++m_pos_NameID;
1322                 m_pos_EncryptedID=m_pos_NameID;
1323                 ++m_pos_EncryptedID;
1324                 m_pos_NewID=m_pos_EncryptedID;
1325                 ++m_pos_NewID;
1326                 m_pos_NewEncryptedID=m_pos_NewID;
1327                 ++m_pos_NewEncryptedID;
1328                 m_pos_Terminate=m_pos_NewEncryptedID;
1329                 ++m_pos_Terminate;
1330                 
1331             }
1332         public:
1333             virtual ~ManageNameIDRequestImpl() { }
1334     
1335             ManageNameIDRequestImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
1336                 : AbstractXMLObject(nsURI, localName, prefix, schemaType)
1337             {
1338                 init();
1339             }
1340                 
1341             ManageNameIDRequestImpl(const ManageNameIDRequestImpl& src) : AbstractXMLObject(src), RequestImpl(src) {
1342                 init();
1343
1344                 if (src.getNameID())
1345                     setNameID(src.getNameID()->cloneNameID());
1346                 if (src.getEncryptedID())
1347                     setEncryptedID(src.getEncryptedID()->cloneEncryptedID());
1348                 if (src.getNewID())
1349                     setNewID(src.getNewID()->cloneNewID());
1350                 if (src.getNewEncryptedID())
1351                     setNewEncryptedID(src.getNewEncryptedID()->cloneNewEncryptedID());
1352                 if (src.getTerminate())
1353                     setTerminate(src.getTerminate()->cloneTerminate());
1354
1355             }
1356             
1357             IMPL_XMLOBJECT_CLONE(ManageNameIDRequest);
1358
1359             IMPL_TYPED_FOREIGN_CHILD(NameID,saml2);
1360             IMPL_TYPED_FOREIGN_CHILD(EncryptedID,saml2);
1361             IMPL_TYPED_CHILD(NewID);
1362             IMPL_TYPED_CHILD(NewEncryptedID);
1363             IMPL_TYPED_CHILD(Terminate);
1364     
1365         protected:
1366             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
1367                 PROC_TYPED_FOREIGN_CHILD(NameID,saml2,SAMLConstants::SAML20_NS,false);
1368                 PROC_TYPED_FOREIGN_CHILD(EncryptedID,saml2,SAMLConstants::SAML20_NS,false);
1369                 PROC_TYPED_CHILD(NewID,SAMLConstants::SAML20P_NS,false);
1370                 PROC_TYPED_CHILD(NewEncryptedID,SAMLConstants::SAML20P_NS,false);
1371                 PROC_TYPED_CHILD(Terminate,SAMLConstants::SAML20P_NS,false);
1372                 RequestImpl::processChildElement(childXMLObject,root);
1373             }
1374         };
1375
1376         class SAML_DLLLOCAL ManageNameIDResponseImpl : public virtual ManageNameIDResponse, public StatusResponseImpl
1377         {
1378             public:
1379                 virtual ~ManageNameIDResponseImpl() { }
1380     
1381                 ManageNameIDResponseImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
1382                     : AbstractXMLObject(nsURI, localName, prefix, schemaType) { }
1383                 
1384                 ManageNameIDResponseImpl(const ManageNameIDResponseImpl& src) : AbstractXMLObject(src), StatusResponseImpl(src) {
1385                 }
1386
1387                 IMPL_XMLOBJECT_CLONE(ManageNameIDResponse);
1388         };
1389
1390         class SAML_DLLLOCAL LogoutRequestImpl : public virtual LogoutRequest, public RequestImpl
1391         {
1392             void init() {
1393                 m_Reason=NULL;
1394                 m_NotOnOrAfter=NULL;
1395
1396                 m_BaseID=NULL;
1397                 m_NameID=NULL;
1398                 m_EncryptedID=NULL;
1399                 m_children.push_back(NULL);
1400                 m_children.push_back(NULL);
1401                 m_children.push_back(NULL);
1402                 m_pos_BaseID=m_pos_Extensions;
1403                 ++m_pos_BaseID;
1404                 m_pos_NameID=m_pos_BaseID;
1405                 ++m_pos_NameID;
1406                 m_pos_EncryptedID=m_pos_NameID;
1407                 ++m_pos_EncryptedID;
1408                 
1409             }
1410         public:
1411             virtual ~LogoutRequestImpl() {
1412                 XMLString::release(&m_Reason);
1413                 delete m_NotOnOrAfter;
1414             }
1415     
1416             LogoutRequestImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
1417                 : AbstractXMLObject(nsURI, localName, prefix, schemaType)
1418             {
1419                 init();
1420             }
1421                 
1422             LogoutRequestImpl(const LogoutRequestImpl& src) : AbstractXMLObject(src), RequestImpl(src) {
1423                 init();
1424
1425                 setReason(src.getReason());
1426                 setNotOnOrAfter(src.getNotOnOrAfter());
1427
1428                 if (src.getBaseID())
1429                     setBaseID(src.getBaseID()->cloneBaseID());
1430                 if (src.getNameID())
1431                     setNameID(src.getNameID()->cloneNameID());
1432                 if (src.getEncryptedID())
1433                     setEncryptedID(src.getEncryptedID()->cloneEncryptedID());
1434
1435                 for (list<XMLObject*>::const_iterator i=src.m_children.begin(); i!=src.m_children.end(); i++) {
1436                     if (*i) {
1437                         SessionIndex* si = dynamic_cast<SessionIndex*>(*i);
1438                         if (si) {
1439                             getSessionIndexs().push_back(si->cloneSessionIndex());
1440                             continue;
1441                         }
1442                     }
1443                 }
1444             }
1445             
1446             IMPL_XMLOBJECT_CLONE(LogoutRequest);
1447
1448             IMPL_STRING_ATTRIB(Reason);
1449             IMPL_DATETIME_ATTRIB(NotOnOrAfter,SAMLTIME_MAX);
1450             IMPL_TYPED_FOREIGN_CHILD(BaseID,saml2);
1451             IMPL_TYPED_FOREIGN_CHILD(NameID,saml2);
1452             IMPL_TYPED_FOREIGN_CHILD(EncryptedID,saml2);
1453             IMPL_TYPED_CHILDREN(SessionIndex,m_children.end());
1454     
1455         protected:
1456             void marshallAttributes(DOMElement* domElement) const {
1457                 MARSHALL_STRING_ATTRIB(Reason,REASON,NULL);
1458                 MARSHALL_DATETIME_ATTRIB(NotOnOrAfter,NOTONORAFTER,NULL);
1459                 RequestImpl::marshallAttributes(domElement);
1460             }
1461     
1462             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
1463                 PROC_TYPED_FOREIGN_CHILD(BaseID,saml2,SAMLConstants::SAML20_NS,false);
1464                 PROC_TYPED_FOREIGN_CHILD(NameID,saml2,SAMLConstants::SAML20_NS,false);
1465                 PROC_TYPED_FOREIGN_CHILD(EncryptedID,saml2,SAMLConstants::SAML20_NS,false);
1466                 PROC_TYPED_CHILDREN(SessionIndex,SAMLConstants::SAML20P_NS,false);
1467                 RequestImpl::processChildElement(childXMLObject,root);
1468             }
1469             void processAttribute(const DOMAttr* attribute) {
1470                 PROC_STRING_ATTRIB(Reason,REASON,NULL);
1471                 PROC_DATETIME_ATTRIB(NotOnOrAfter,NOTONORAFTER,NULL);
1472                 RequestImpl::processAttribute(attribute);
1473             }
1474         };
1475
1476         class SAML_DLLLOCAL LogoutResponseImpl : public virtual LogoutResponse, public StatusResponseImpl
1477         {
1478             public:
1479                 virtual ~LogoutResponseImpl() { }
1480     
1481                 LogoutResponseImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
1482                     : AbstractXMLObject(nsURI, localName, prefix, schemaType) { }
1483                 
1484                 LogoutResponseImpl(const LogoutResponseImpl& src) : AbstractXMLObject(src), StatusResponseImpl(src) {
1485                 }
1486
1487                 IMPL_XMLOBJECT_CLONE(LogoutResponse);
1488         };
1489
1490
1491         class SAML_DLLLOCAL NameIDMappingRequestImpl : public virtual NameIDMappingRequest, public RequestImpl
1492         {
1493             void init() {
1494                 m_BaseID=NULL;
1495                 m_NameID=NULL;
1496                 m_EncryptedID=NULL;
1497                 m_NameIDPolicy=NULL;
1498                 m_children.push_back(NULL);
1499                 m_children.push_back(NULL);
1500                 m_children.push_back(NULL);
1501                 m_children.push_back(NULL);
1502                 m_pos_BaseID=m_pos_Extensions;
1503                 ++m_pos_BaseID;
1504                 m_pos_NameID=m_pos_BaseID;
1505                 ++m_pos_NameID;
1506                 m_pos_EncryptedID=m_pos_NameID;
1507                 ++m_pos_EncryptedID;
1508                 m_pos_NameIDPolicy=m_pos_EncryptedID;
1509                 ++m_pos_NameIDPolicy;
1510                 
1511             }
1512         public:
1513             virtual ~NameIDMappingRequestImpl() { }
1514     
1515             NameIDMappingRequestImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
1516                 : AbstractXMLObject(nsURI, localName, prefix, schemaType)
1517             {
1518                 init();
1519             }
1520                 
1521             NameIDMappingRequestImpl(const NameIDMappingRequestImpl& src) : AbstractXMLObject(src), RequestImpl(src) {
1522                 init();
1523
1524                 if (src.getBaseID())
1525                     setBaseID(src.getBaseID()->cloneBaseID());
1526                 if (src.getNameID())
1527                     setNameID(src.getNameID()->cloneNameID());
1528                 if (src.getEncryptedID())
1529                     setEncryptedID(src.getEncryptedID()->cloneEncryptedID());
1530                 if (src.getNameIDPolicy())
1531                     setNameIDPolicy(src.getNameIDPolicy()->cloneNameIDPolicy());
1532
1533             }
1534             
1535             IMPL_XMLOBJECT_CLONE(NameIDMappingRequest);
1536
1537             IMPL_TYPED_FOREIGN_CHILD(BaseID,saml2);
1538             IMPL_TYPED_FOREIGN_CHILD(NameID,saml2);
1539             IMPL_TYPED_FOREIGN_CHILD(EncryptedID,saml2);
1540             IMPL_TYPED_CHILD(NameIDPolicy);
1541     
1542         protected:
1543             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
1544                 PROC_TYPED_FOREIGN_CHILD(BaseID,saml2,SAMLConstants::SAML20_NS,false);
1545                 PROC_TYPED_FOREIGN_CHILD(NameID,saml2,SAMLConstants::SAML20_NS,false);
1546                 PROC_TYPED_FOREIGN_CHILD(EncryptedID,saml2,SAMLConstants::SAML20_NS,false);
1547                 PROC_TYPED_CHILD(NameIDPolicy,SAMLConstants::SAML20P_NS,false);
1548                 RequestImpl::processChildElement(childXMLObject,root);
1549             }
1550         };
1551
1552         class SAML_DLLLOCAL NameIDMappingResponseImpl : public virtual NameIDMappingResponse, public StatusResponseImpl
1553         {
1554             void init() {
1555                 m_NameID=NULL;
1556                 m_EncryptedID=NULL;
1557                 m_children.push_back(NULL);
1558                 m_children.push_back(NULL);
1559                 m_pos_NameID=m_pos_Status;
1560                 ++m_pos_NameID;
1561                 m_pos_EncryptedID=m_pos_NameID;
1562                 ++m_pos_EncryptedID;
1563             }
1564         public:
1565             virtual ~NameIDMappingResponseImpl() { }
1566     
1567             NameIDMappingResponseImpl(const XMLCh* nsURI, const XMLCh* localName, const XMLCh* prefix, const QName* schemaType)
1568                 : AbstractXMLObject(nsURI, localName, prefix, schemaType)
1569             {
1570                 init();
1571             }
1572                 
1573             NameIDMappingResponseImpl(const NameIDMappingResponseImpl& src) : AbstractXMLObject(src), StatusResponseImpl(src) {
1574                 init();
1575
1576                 if (src.getNameID())
1577                     setNameID(getNameID()->cloneNameID());
1578                 if (src.getEncryptedID())
1579                     setEncryptedID(getEncryptedID()->cloneEncryptedID());
1580
1581             }
1582             
1583             IMPL_XMLOBJECT_CLONE(NameIDMappingResponse);
1584             IMPL_TYPED_FOREIGN_CHILD(NameID,saml2);
1585             IMPL_TYPED_FOREIGN_CHILD(EncryptedID,saml2);
1586     
1587         protected:
1588             void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
1589                 PROC_TYPED_FOREIGN_CHILD(NameID,saml2,SAMLConstants::SAML20_NS,false);
1590                 PROC_TYPED_FOREIGN_CHILD(EncryptedID,saml2,SAMLConstants::SAML20_NS,false);
1591                 StatusResponseImpl::processChildElement(childXMLObject,root);
1592             }
1593         };
1594     };
1595 };
1596
1597 #if defined (_MSC_VER)
1598     #pragma warning( pop )
1599 #endif
1600
1601 // Builder Implementations
1602 IMPL_XMLOBJECTBUILDER(Artifact);
1603 IMPL_XMLOBJECTBUILDER(ArtifactResolve);
1604 IMPL_XMLOBJECTBUILDER(ArtifactResponse);
1605 IMPL_XMLOBJECTBUILDER(AssertionIDRequest);
1606 IMPL_XMLOBJECTBUILDER(AttributeQuery);
1607 IMPL_XMLOBJECTBUILDER(AuthnQuery);
1608 IMPL_XMLOBJECTBUILDER(AuthnRequest);
1609 IMPL_XMLOBJECTBUILDER(AuthzDecisionQuery);
1610 IMPL_XMLOBJECTBUILDER(Extensions);
1611 IMPL_XMLOBJECTBUILDER(GetComplete);
1612 IMPL_XMLOBJECTBUILDER(IDPEntry);
1613 IMPL_XMLOBJECTBUILDER(IDPList);
1614 IMPL_XMLOBJECTBUILDER(LogoutRequest);
1615 IMPL_XMLOBJECTBUILDER(LogoutResponse);
1616 IMPL_XMLOBJECTBUILDER(ManageNameIDRequest);
1617 IMPL_XMLOBJECTBUILDER(ManageNameIDResponse);
1618 IMPL_XMLOBJECTBUILDER(NameIDMappingRequest);
1619 IMPL_XMLOBJECTBUILDER(NameIDMappingResponse);
1620 IMPL_XMLOBJECTBUILDER(NameIDPolicy);
1621 IMPL_XMLOBJECTBUILDER(NewEncryptedID);
1622 IMPL_XMLOBJECTBUILDER(NewID);
1623 IMPL_XMLOBJECTBUILDER(RequestedAuthnContext);
1624 IMPL_XMLOBJECTBUILDER(RequesterID);
1625 IMPL_XMLOBJECTBUILDER(Response);
1626 IMPL_XMLOBJECTBUILDER(Scoping);
1627 IMPL_XMLOBJECTBUILDER(SessionIndex);
1628 IMPL_XMLOBJECTBUILDER(Status);
1629 IMPL_XMLOBJECTBUILDER(StatusCode);
1630 IMPL_XMLOBJECTBUILDER(StatusDetail);
1631 IMPL_XMLOBJECTBUILDER(StatusMessage);
1632 IMPL_XMLOBJECTBUILDER(StatusResponse);
1633 IMPL_XMLOBJECTBUILDER(Terminate);
1634
1635 IMPL_XMLOBJECTBUILDER(RespondTo);
1636
1637 // Unicode literals
1638 const XMLCh Artifact::LOCAL_NAME[] = UNICODE_LITERAL_8(A,r,t,i,f,a,c,t);
1639 const XMLCh ArtifactResolve::LOCAL_NAME[] = UNICODE_LITERAL_15(A,r,t,i,f,a,c,t,R,e,s,o,l,v,e);
1640 const XMLCh ArtifactResolve::TYPE_NAME[] = UNICODE_LITERAL_19(A,r,t,i,f,a,c,t,R,e,s,o,l,v,e,T,y,p,e);
1641 const XMLCh ArtifactResponse::LOCAL_NAME[] = UNICODE_LITERAL_16(A,r,t,i,f,a,c,t,R,e,s,p,o,n,s,e);
1642 const XMLCh ArtifactResponse::TYPE_NAME[] = UNICODE_LITERAL_20(A,r,t,i,f,a,c,t,R,e,s,p,o,n,s,e,T,y,p,e);
1643 const XMLCh AssertionIDRequest::LOCAL_NAME[] = UNICODE_LITERAL_18(A,s,s,e,r,t,i,o,n,I,D,R,e,q,u,e,s,t);
1644 const XMLCh AssertionIDRequest::TYPE_NAME[] = UNICODE_LITERAL_22(A,s,s,e,r,t,i,o,n,I,D,R,e,q,u,e,s,t,T,y,p,e);
1645 const XMLCh AttributeQuery::LOCAL_NAME[] = UNICODE_LITERAL_14(A,t,t,r,i,b,u,t,e,Q,u,e,r,y);
1646 const XMLCh AttributeQuery::TYPE_NAME[] = UNICODE_LITERAL_18(A,t,t,r,i,b,u,t,e,Q,u,e,r,y,T,y,p,e);
1647 const XMLCh AuthnQuery::LOCAL_NAME[] = UNICODE_LITERAL_10(A,u,t,h,n,Q,u,e,r,y);
1648 const XMLCh AuthnQuery::TYPE_NAME[] = UNICODE_LITERAL_14(A,u,t,h,n,Q,u,e,r,y,T,y,p,e);
1649 const XMLCh AuthnQuery::SESSIONINDEX_ATTRIB_NAME[] = UNICODE_LITERAL_12(S,e,s,s,i,o,n,I,n,d,e,x);
1650 const XMLCh AuthnRequest::LOCAL_NAME[] = UNICODE_LITERAL_12(A,u,t,h,n,R,e,q,u,e,s,t);
1651 const XMLCh AuthnRequest::TYPE_NAME[] = UNICODE_LITERAL_16(A,u,t,h,n,R,e,q,u,e,s,t,T,y,p,e);
1652 const XMLCh AuthnRequest::FORCEAUTHN_ATTRIB_NAME[] = UNICODE_LITERAL_10(F,o,r,c,e,A,u,t,h,n);
1653 const XMLCh AuthnRequest::ISPASSIVE_ATTRIB_NAME[] = UNICODE_LITERAL_9(I,s,P,a,s,s,i,v,e);
1654 const XMLCh AuthnRequest::PROTOCOLBINDING_ATTRIB_NAME[] = UNICODE_LITERAL_15(P,r,o,t,o,c,o,l,B,i,n,d,i,n,g);
1655 const XMLCh AuthnRequest::ASSERTIONCONSUMERSERVICEINDEX_ATTRIB_NAME[] = UNICODE_LITERAL_29(A,s,s,e,r,t,i,o,n,C,o,n,s,u,m,e,r,S,e,r,v,i,c,e,I,n,d,e,x);
1656 const XMLCh AuthnRequest::ASSERTIONCONSUMERSERVICEURL_ATTRIB_NAME[] = UNICODE_LITERAL_27(A,s,s,e,r,t,i,o,n,C,o,n,s,u,m,e,r,S,e,r,v,i,c,e,U,R,L);
1657 const XMLCh AuthnRequest::ATTRIBUTECONSUMINGSERVICEINDEX_ATTRIB_NAME[] = UNICODE_LITERAL_30(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,I,n,d,e,x);
1658 const XMLCh AuthnRequest::PROVIDERNAME_ATTRIB_NAME[] = UNICODE_LITERAL_12(P,r,o,v,i,d,e,r,N,a,m,e);
1659 const XMLCh AuthzDecisionQuery::LOCAL_NAME[] = UNICODE_LITERAL_18(A,u,t,h,z,D,e,c,i,s,i,o,n,Q,u,e,r,y);
1660 const XMLCh AuthzDecisionQuery::TYPE_NAME[] = UNICODE_LITERAL_22(A,u,t,h,z,D,e,c,i,s,i,o,n,Q,u,e,r,y,T,y,p,e);
1661 const XMLCh AuthzDecisionQuery::RESOURCE_ATTRIB_NAME[] = UNICODE_LITERAL_8(R,e,s,o,u,r,c,e);
1662 const XMLCh Extensions::LOCAL_NAME[] = UNICODE_LITERAL_10(E,x,t,e,n,s,i,o,n,s);
1663 const XMLCh Extensions::TYPE_NAME[] = UNICODE_LITERAL_14(E,x,t,e,n,s,i,o,n,s,T,y,p,e);
1664 const XMLCh GetComplete::LOCAL_NAME[] = UNICODE_LITERAL_11(G,e,t,C,o,m,p,l,e,t,e);
1665 const XMLCh IDPEntry::LOCAL_NAME[] = UNICODE_LITERAL_8(I,D,P,E,n,t,r,y);
1666 const XMLCh IDPEntry::TYPE_NAME[] = UNICODE_LITERAL_12(I,D,P,E,n,t,r,y,T,y,p,e);
1667 const XMLCh IDPEntry::PROVIDERID_ATTRIB_NAME[] = UNICODE_LITERAL_10(P,r,o,v,i,d,e,r,I,D);
1668 const XMLCh IDPEntry::NAME_ATTRIB_NAME[] = UNICODE_LITERAL_4(N,a,m,e);
1669 const XMLCh IDPEntry::LOC_ATTRIB_NAME[] = UNICODE_LITERAL_3(L,o,c);
1670 const XMLCh IDPList::LOCAL_NAME[] = UNICODE_LITERAL_7(I,D,P,L,i,s,t);
1671 const XMLCh IDPList::TYPE_NAME[] = UNICODE_LITERAL_11(I,D,P,L,i,s,t,T,y,p,e);
1672 const XMLCh LogoutRequest::LOCAL_NAME[] = UNICODE_LITERAL_13(L,o,g,o,u,t,R,e,q,u,e,s,t);
1673 const XMLCh LogoutRequest::TYPE_NAME[] = UNICODE_LITERAL_17(L,o,g,o,u,t,R,e,q,u,e,s,t,T,y,p,e);
1674 const XMLCh LogoutRequest::REASON_ATTRIB_NAME[] = UNICODE_LITERAL_6(R,e,a,s,o,n);
1675 const XMLCh LogoutRequest::NOTONORAFTER_ATTRIB_NAME[] = UNICODE_LITERAL_12(N,o,t,O,n,O,r,A,f,t,e,r);
1676 const XMLCh LogoutResponse::LOCAL_NAME[] = UNICODE_LITERAL_14(L,o,g,o,u,t,R,e,s,p,o,n,s,e);
1677 const XMLCh ManageNameIDRequest::LOCAL_NAME[] = UNICODE_LITERAL_19(M,a,n,a,g,e,N,a,m,e,I,D,R,e,q,u,e,s,t);
1678 const XMLCh ManageNameIDRequest::TYPE_NAME[] = UNICODE_LITERAL_23(M,a,n,a,g,e,N,a,m,e,I,D,R,e,q,u,e,s,t,T,y,p,e);
1679 const XMLCh ManageNameIDResponse::LOCAL_NAME[] = UNICODE_LITERAL_20(M,a,n,a,g,e,N,a,m,e,I,D,R,e,s,p,o,n,s,e);
1680 const XMLCh NameIDMappingRequest::LOCAL_NAME[] = UNICODE_LITERAL_20(N,a,m,e,I,D,M,a,p,p,i,n,g,R,e,q,u,e,s,t);
1681 const XMLCh NameIDMappingRequest::TYPE_NAME[] = UNICODE_LITERAL_24(N,a,m,e,I,D,M,a,p,p,i,n,g,R,e,q,u,e,s,t,T,y,p,e);
1682 const XMLCh NameIDMappingResponse::LOCAL_NAME[] = UNICODE_LITERAL_21(N,a,m,e,I,D,M,a,p,p,i,n,g,R,e,s,p,o,n,s,e);
1683 const XMLCh NameIDMappingResponse::TYPE_NAME[] = UNICODE_LITERAL_25(N,a,m,e,I,D,M,a,p,p,i,n,g,R,e,s,p,o,n,s,e,T,y,p,e);
1684 const XMLCh NameIDPolicy::LOCAL_NAME[] = UNICODE_LITERAL_12(N,a,m,e,I,D,P,o,l,i,c,y);
1685 const XMLCh NameIDPolicy::TYPE_NAME[] = UNICODE_LITERAL_16(N,a,m,e,I,D,P,o,l,i,c,y,T,y,p,e);
1686 const XMLCh NameIDPolicy::FORMAT_ATTRIB_NAME[] = UNICODE_LITERAL_6(F,o,r,m,a,t);
1687 const XMLCh NameIDPolicy::SPNAMEQUALIFIER_ATTRIB_NAME[] = UNICODE_LITERAL_15(S,P,N,a,m,e,Q,u,a,l,i,f,i,e,r);
1688 const XMLCh NameIDPolicy::ALLOWCREATE_ATTRIB_NAME[] = UNICODE_LITERAL_11(A,l,l,o,w,C,r,e,a,t,e);
1689 const XMLCh NewEncryptedID::LOCAL_NAME[] = UNICODE_LITERAL_14(N,e,w,E,n,c,r,y,p,t,e,d,I,D);
1690 const XMLCh NewID::LOCAL_NAME[] = UNICODE_LITERAL_5(N,e,w,I,D);
1691 const XMLCh RequesterID::LOCAL_NAME[] = UNICODE_LITERAL_11(R,e,q,u,e,s,t,e,r,I,D);
1692 const XMLCh RequestedAuthnContext::LOCAL_NAME[] = UNICODE_LITERAL_21(R,e,q,u,e,s,t,e,d,A,u,t,h,n,C,o,n,t,e,x,t);
1693 const XMLCh RequestedAuthnContext::TYPE_NAME[] = UNICODE_LITERAL_25(R,e,q,u,e,s,t,e,d,A,u,t,h,n,C,o,n,t,e,x,t,T,y,p,e);
1694 const XMLCh RequestedAuthnContext::COMPARISON_ATTRIB_NAME[] = UNICODE_LITERAL_10(C,o,m,p,a,r,i,s,o,n);
1695 const XMLCh RequestedAuthnContext::COMPARISON_EXACT[] = UNICODE_LITERAL_5(e,x,a,c,t);
1696 const XMLCh RequestedAuthnContext::COMPARISON_MINIMUM[] = UNICODE_LITERAL_7(m,i,n,i,m,u,m);
1697 const XMLCh RequestedAuthnContext::COMPARISON_MAXIMUM[] = UNICODE_LITERAL_7(m,a,x,i,m,u,m);
1698 const XMLCh RequestedAuthnContext::COMPARISON_BETTER[] = UNICODE_LITERAL_6(b,e,t,t,e,r);
1699 const XMLCh Request::LOCAL_NAME[] = {chNull};
1700 const XMLCh Request::TYPE_NAME[] = UNICODE_LITERAL_19(R,e,q,u,e,s,t,A,b,s,t,r,a,c,t,T,y,p,e);
1701 const XMLCh Request::ID_ATTRIB_NAME[] = UNICODE_LITERAL_2(I,D);
1702 const XMLCh Request::VER_ATTRIB_NAME[] = UNICODE_LITERAL_7(V,e,r,s,i,o,n);
1703 const XMLCh Request::ISSUEINSTANT_ATTRIB_NAME[] = UNICODE_LITERAL_12(I,s,s,u,e,I,n,s,t,a,n,t);
1704 const XMLCh Request::DESTINATION_ATTRIB_NAME[] = UNICODE_LITERAL_11(D,e,s,t,i,n,a,t,i,o,n);
1705 const XMLCh Request::CONSENT_ATTRIB_NAME[] = UNICODE_LITERAL_7(C,o,n,s,e,n,t);
1706 const XMLCh RespondTo::LOCAL_NAME[] = UNICODE_LITERAL_9(R,e,s,p,o,n,d,T,o);
1707 const XMLCh Response::LOCAL_NAME[] = UNICODE_LITERAL_8(R,e,s,p,o,n,s,e);
1708 const XMLCh Response::TYPE_NAME[] = UNICODE_LITERAL_12(R,e,s,p,o,n,s,e,T,y,p,e);
1709 const XMLCh Scoping::LOCAL_NAME[] = UNICODE_LITERAL_7(S,c,o,p,i,n,g);
1710 const XMLCh Scoping::TYPE_NAME[] = UNICODE_LITERAL_11(S,c,o,p,i,n,g,T,y,p,e);
1711 const XMLCh Scoping::PROXYCOUNT_ATTRIB_NAME[] = UNICODE_LITERAL_10(P,r,o,x,y,C,o,u,n,t);
1712 const XMLCh SessionIndex::LOCAL_NAME[] = UNICODE_LITERAL_12(S,e,s,s,i,o,n,I,n,d,e,x);
1713 const XMLCh Status::LOCAL_NAME[] = UNICODE_LITERAL_6(S,t,a,t,u,s);
1714 const XMLCh Status::TYPE_NAME[] = UNICODE_LITERAL_10(S,t,a,t,u,s,T,y,p,e);
1715 const XMLCh StatusCode::LOCAL_NAME[] = UNICODE_LITERAL_10(S,t,a,t,u,s,C,o,d,e);
1716 const XMLCh StatusCode::TYPE_NAME[] = UNICODE_LITERAL_14(S,t,a,t,u,s,C,o,d,e,T,y,p,e);
1717 const XMLCh StatusCode::VALUE_ATTRIB_NAME[] = UNICODE_LITERAL_5(V,a,l,u,e);
1718 const XMLCh StatusDetail::LOCAL_NAME[] = UNICODE_LITERAL_12(S,t,a,t,u,s,D,e,t,a,i,l);
1719 const XMLCh StatusDetail::TYPE_NAME[] = UNICODE_LITERAL_16(S,t,a,t,u,s,D,e,t,a,i,l,T,y,p,e);
1720 const XMLCh StatusMessage::LOCAL_NAME[] = UNICODE_LITERAL_13(S,t,a,t,u,s,M,e,s,s,a,g,e);
1721 const XMLCh StatusResponse::LOCAL_NAME[] = {chNull};
1722 const XMLCh StatusResponse::TYPE_NAME[] = UNICODE_LITERAL_18(S,t,a,t,u,s,R,e,s,p,o,n,s,e,T,y,p,e);
1723 const XMLCh StatusResponse::ID_ATTRIB_NAME[] = UNICODE_LITERAL_2(I,D);
1724 const XMLCh StatusResponse::INRESPONSETO_ATTRIB_NAME[] = UNICODE_LITERAL_12(I,n,R,e,s,p,o,n,s,e,T,o);
1725 const XMLCh StatusResponse::VER_ATTRIB_NAME[] = UNICODE_LITERAL_7(V,e,r,s,i,o,n);
1726 const XMLCh StatusResponse::ISSUEINSTANT_ATTRIB_NAME[] = UNICODE_LITERAL_12(I,s,s,u,e,I,n,s,t,a,n,t);
1727 const XMLCh StatusResponse::DESTINATION_ATTRIB_NAME[] = UNICODE_LITERAL_11(D,e,s,t,i,n,a,t,i,o,n);
1728 const XMLCh StatusResponse::CONSENT_ATTRIB_NAME[] = UNICODE_LITERAL_7(C,o,n,s,e,n,t);
1729 const XMLCh SubjectQuery::LOCAL_NAME[] = {chNull};
1730 const XMLCh SubjectQuery::TYPE_NAME[] = UNICODE_LITERAL_16(S,u,b,j,e,c,t,Q,u,e,r,y,T,y,p,e);
1731 const XMLCh Terminate::LOCAL_NAME[] = UNICODE_LITERAL_9(T,e,r,m,i,n,a,t,e);
1732 const XMLCh Terminate::TYPE_NAME[] = UNICODE_LITERAL_13(T,e,r,m,i,n,a,t,e,T,y,p,e);
1733
1734 // Unicode literals: LogoutRequest element, Reason attribute
1735 const XMLCh LogoutRequest::REASON_USER[] = // urn:oasis:names:tc:SAML:2.0:logout:user
1736 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1737   chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1738   chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
1739   chLatin_l, chLatin_o, chLatin_g, chLatin_o, chLatin_u, chLatin_t, chColon,
1740   chLatin_u, chLatin_s, chLatin_e, chLatin_r, chNull
1741 };
1742
1743 const XMLCh LogoutRequest::REASON_ADMIN[] = // urn:oasis:names:tc:SAML:2.0:logout:admin
1744 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1745   chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1746   chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
1747   chLatin_l, chLatin_o, chLatin_g, chLatin_o, chLatin_u, chLatin_t, chColon,
1748   chLatin_a, chLatin_d, chLatin_m, chLatin_i, chLatin_n, chNull
1749 };
1750
1751
1752 const XMLCh LogoutRequest::REASON_GLOBAL_TIMEOUT[] = // urn:oasis:names:tc:SAML:2.0:logout:global-timeout
1753 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1754   chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1755   chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
1756   chLatin_l, chLatin_o, chLatin_g, chLatin_o, chLatin_u, chLatin_t, chColon,
1757   chLatin_g, chLatin_l, chLatin_o, chLatin_b, chLatin_a, chLatin_l, 
1758     chDash, chLatin_t, chLatin_i, chLatin_m, chLatin_e, chLatin_o, chLatin_u, chLatin_t, chNull
1759 };
1760
1761
1762 const XMLCh LogoutRequest::REASON_SP_TIMEOUT[] = // urn:oasis:names:tc:SAML:2.0:logout:sp-timeout
1763 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1764   chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1765   chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
1766   chLatin_l, chLatin_o, chLatin_g, chLatin_o, chLatin_u, chLatin_t, chColon,
1767   chLatin_s, chLatin_p, chDash, chLatin_t, chLatin_i, chLatin_m, chLatin_e, chLatin_o, chLatin_u, chLatin_t, chNull
1768 };
1769
1770
1771 // Unicode literals, StatusCode Value
1772 const XMLCh StatusCode::SUCCESS[] = //  urn:oasis:names:tc:SAML:2.0:status:Success 
1773 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1774   chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1775   chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
1776   chLatin_s, chLatin_t, chLatin_a, chLatin_t, chLatin_u, chLatin_s, chColon,
1777   chLatin_S, chLatin_u, chLatin_c, chLatin_c, chLatin_e, chLatin_s, chLatin_s, chNull
1778 };
1779
1780 const XMLCh StatusCode::REQUESTER[] = //  urn:oasis:names:tc:SAML:2.0:status:Requester 
1781 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1782   chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1783   chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
1784   chLatin_s, chLatin_t, chLatin_a, chLatin_t, chLatin_u, chLatin_s, chColon,
1785   chLatin_R, chLatin_e, chLatin_q, chLatin_u, chLatin_e, chLatin_s, chLatin_t, chLatin_e, chLatin_r, chNull
1786 };
1787
1788 const XMLCh StatusCode::RESPONDER[] = //  urn:oasis:names:tc:SAML:2.0:status:Responder 
1789 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1790   chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1791   chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
1792   chLatin_s, chLatin_t, chLatin_a, chLatin_t, chLatin_u, chLatin_s, chColon,
1793   chLatin_R, chLatin_e, chLatin_s, chLatin_p, chLatin_o, chLatin_n, chLatin_d, chLatin_e, chLatin_r, chNull
1794 };
1795
1796 const XMLCh StatusCode::VERSION_MISMATCH[] = //  urn:oasis:names:tc:SAML:2.0:status:VersionMismatch 
1797 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1798   chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1799   chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
1800   chLatin_s, chLatin_t, chLatin_a, chLatin_t, chLatin_u, chLatin_s, chColon,
1801   chLatin_V, chLatin_e, chLatin_r, chLatin_s, chLatin_i, chLatin_o, chLatin_n,
1802     chLatin_M, chLatin_i, chLatin_s, chLatin_m, chLatin_a, chLatin_t, chLatin_c, chLatin_h, chNull
1803 };
1804
1805 const XMLCh StatusCode::AUTHN_FAILED[] = //  urn:oasis:names:tc:SAML:2.0:status:AuthnFailed 
1806 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1807   chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1808   chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
1809   chLatin_s, chLatin_t, chLatin_a, chLatin_t, chLatin_u, chLatin_s, chColon,
1810   chLatin_A, chLatin_u, chLatin_t, chLatin_h, chLatin_n,
1811     chLatin_F, chLatin_a, chLatin_i, chLatin_l, chLatin_e, chLatin_d, chNull
1812 };
1813
1814 const XMLCh StatusCode::INVALID_ATTR_NAME_OR_VALUE[] = //  urn:oasis:names:tc:SAML:2.0:status:InvalidAttrNameOrValue 
1815 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1816   chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1817   chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
1818   chLatin_s, chLatin_t, chLatin_a, chLatin_t, chLatin_u, chLatin_s, chColon,
1819   chLatin_I, chLatin_n, chLatin_v, chLatin_a, chLatin_l, chLatin_i, chLatin_d, 
1820     chLatin_A, chLatin_t, chLatin_t, chLatin_r, chLatin_N, chLatin_a, chLatin_m, chLatin_e, 
1821     chLatin_O, chLatin_r, chLatin_V, chLatin_a, chLatin_l, chLatin_u, chLatin_e, chNull
1822 };
1823
1824 const XMLCh StatusCode::INVALID_NAMEID_POLICY[] = //  urn:oasis:names:tc:SAML:2.0:status:InvalidNameIDPolicy 
1825 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1826   chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1827   chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
1828   chLatin_s, chLatin_t, chLatin_a, chLatin_t, chLatin_u, chLatin_s, chColon,
1829   chLatin_I, chLatin_n, chLatin_v, chLatin_a, chLatin_l, chLatin_i, chLatin_d, 
1830    chLatin_N, chLatin_a, chLatin_m, chLatin_e, chLatin_I, chLatin_D, 
1831    chLatin_P, chLatin_o, chLatin_l, chLatin_i, chLatin_c, chLatin_y, chNull
1832 };
1833
1834 const XMLCh StatusCode::NO_AUTHN_CONTEXT[] = //  urn:oasis:names:tc:SAML:2.0:status:NoAuthnContext 
1835 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1836   chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1837   chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
1838   chLatin_s, chLatin_t, chLatin_a, chLatin_t, chLatin_u, chLatin_s, chColon,
1839   chLatin_N, chLatin_o, chLatin_A, chLatin_u, chLatin_t, chLatin_h, chLatin_n, 
1840   chLatin_C, chLatin_o, chLatin_n, chLatin_t, chLatin_e, chLatin_x, chLatin_t, chNull
1841 };
1842
1843 const XMLCh StatusCode::NO_AVAILABLE_IDP[] = //  urn:oasis:names:tc:SAML:2.0:status:NoAvailableIDP 
1844 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1845   chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1846   chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
1847   chLatin_s, chLatin_t, chLatin_a, chLatin_t, chLatin_u, chLatin_s, chColon,
1848   chLatin_N, chLatin_o, chLatin_A, chLatin_v, chLatin_a, chLatin_i, chLatin_l, chLatin_a, chLatin_b, chLatin_l, chLatin_e, 
1849    chLatin_I, chLatin_D, chLatin_P, chNull
1850 };
1851
1852 const XMLCh StatusCode::NO_PASSIVE[] = //  urn:oasis:names:tc:SAML:2.0:status:NoPassive 
1853 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1854   chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1855   chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
1856   chLatin_s, chLatin_t, chLatin_a, chLatin_t, chLatin_u, chLatin_s, chColon,
1857   chLatin_N, chLatin_o, chLatin_P, chLatin_a, chLatin_s, chLatin_s, chLatin_i, chLatin_v, chLatin_e, chNull
1858 };
1859
1860 const XMLCh StatusCode::NO_SUPPORTED_IDP[] = //  urn:oasis:names:tc:SAML:2.0:status:NoSupportedIDP 
1861 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1862   chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1863   chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
1864   chLatin_s, chLatin_t, chLatin_a, chLatin_t, chLatin_u, chLatin_s, chColon,
1865   chLatin_N, chLatin_o, chLatin_S, chLatin_u, chLatin_p, chLatin_p, chLatin_o, chLatin_r, chLatin_t, chLatin_e, chLatin_d,
1866       chLatin_I, chLatin_D, chLatin_P, chNull
1867 };
1868
1869 const XMLCh StatusCode::PARTIAL_LOGOUT[] = //  urn:oasis:names:tc:SAML:2.0:status:PartialLogout 
1870 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1871   chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1872   chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
1873   chLatin_s, chLatin_t, chLatin_a, chLatin_t, chLatin_u, chLatin_s, chColon,
1874   chLatin_P, chLatin_a, chLatin_r, chLatin_t, chLatin_i, chLatin_a, chLatin_l, 
1875     chLatin_L, chLatin_o, chLatin_g, chLatin_o, chLatin_u, chLatin_t, chNull
1876 };
1877
1878 const XMLCh StatusCode::PROXY_COUNT_EXCEEDED[] = //  urn:oasis:names:tc:SAML:2.0:status:ProxyCountExceeded 
1879 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1880   chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1881   chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
1882   chLatin_s, chLatin_t, chLatin_a, chLatin_t, chLatin_u, chLatin_s, chColon,
1883   chLatin_P, chLatin_r, chLatin_o, chLatin_x, chLatin_y, chLatin_C, chLatin_o, chLatin_u, chLatin_n, chLatin_t, 
1884     chLatin_E, chLatin_x, chLatin_c, chLatin_e, chLatin_e, chLatin_d, chLatin_e, chLatin_d, chNull
1885 };
1886
1887 const XMLCh StatusCode::REQUEST_DENIED[] = //  urn:oasis:names:tc:SAML:2.0:status:RequestDenied 
1888 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1889   chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1890   chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
1891   chLatin_s, chLatin_t, chLatin_a, chLatin_t, chLatin_u, chLatin_s, chColon,
1892   chLatin_R, chLatin_e, chLatin_q, chLatin_u, chLatin_e, chLatin_s, chLatin_t, 
1893     chLatin_D, chLatin_e, chLatin_n, chLatin_i, chLatin_e, chLatin_d, chNull
1894 };
1895
1896 const XMLCh StatusCode::REQUEST_UNSUPPORTED[] = //  urn:oasis:names:tc:SAML:2.0:status:RequestUnsupported 
1897 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1898   chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1899   chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
1900   chLatin_s, chLatin_t, chLatin_a, chLatin_t, chLatin_u, chLatin_s, chColon,
1901   chLatin_R, chLatin_e, chLatin_q, chLatin_u, chLatin_e, chLatin_s, chLatin_t, 
1902     chLatin_U, chLatin_n, chLatin_s, chLatin_u, chLatin_p, chLatin_p, chLatin_o, chLatin_r, chLatin_t, chLatin_e, chLatin_d, chNull
1903 };
1904
1905 const XMLCh StatusCode::REQUEST_VERSION_DEPRECATED[] = //  urn:oasis:names:tc:SAML:2.0:status:RequestVersionDeprecated 
1906 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1907   chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1908   chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
1909   chLatin_s, chLatin_t, chLatin_a, chLatin_t, chLatin_u, chLatin_s, chColon,
1910   chLatin_R, chLatin_e, chLatin_q, chLatin_u, chLatin_e, chLatin_s, chLatin_t, 
1911     chLatin_V, chLatin_e, chLatin_r, chLatin_s, chLatin_i, chLatin_o, chLatin_n, 
1912     chLatin_D, chLatin_e, chLatin_p, chLatin_r, chLatin_e, chLatin_c, chLatin_a, chLatin_t, chLatin_e, chLatin_d, chNull
1913 };
1914
1915 const XMLCh StatusCode::REQUEST_VERSION_TOO_HIGH[] = //  urn:oasis:names:tc:SAML:2.0:status:RequestVersionTooHigh 
1916 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1917   chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1918   chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
1919   chLatin_s, chLatin_t, chLatin_a, chLatin_t, chLatin_u, chLatin_s, chColon,
1920   chLatin_R, chLatin_e, chLatin_q, chLatin_u, chLatin_e, chLatin_s, chLatin_t, 
1921   chLatin_V, chLatin_e, chLatin_r, chLatin_s, chLatin_i, chLatin_o, chLatin_n, 
1922   chLatin_T, chLatin_o, chLatin_o, chLatin_H, chLatin_i, chLatin_g, chLatin_h, chNull
1923 };
1924
1925 const XMLCh StatusCode::REQUEST_VERSION_TOO_LOW[] = //  urn:oasis:names:tc:SAML:2.0:status:RequestVersionTooLow 
1926 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1927   chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1928   chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
1929   chLatin_s, chLatin_t, chLatin_a, chLatin_t, chLatin_u, chLatin_s, chColon,
1930   chLatin_R, chLatin_e, chLatin_q, chLatin_u, chLatin_e, chLatin_s, chLatin_t, 
1931     chLatin_V, chLatin_e, chLatin_r, chLatin_s, chLatin_i, chLatin_o, chLatin_n, 
1932     chLatin_T, chLatin_o, chLatin_o, chLatin_L, chLatin_o, chLatin_w, chNull
1933 };
1934
1935 const XMLCh StatusCode::RESOURCE_NOT_RECOGNIZED[] = //  urn:oasis:names:tc:SAML:2.0:status:ResourceNotRecognized 
1936 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1937   chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1938   chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
1939   chLatin_s, chLatin_t, chLatin_a, chLatin_t, chLatin_u, chLatin_s, chColon,
1940   chLatin_R, chLatin_e, chLatin_s, chLatin_o, chLatin_u, chLatin_r, chLatin_c, chLatin_e, 
1941     chLatin_N, chLatin_o, chLatin_t, 
1942     chLatin_R, chLatin_e, chLatin_c, chLatin_o, chLatin_g, chLatin_n, chLatin_i, chLatin_z, chLatin_e, chLatin_d, chNull
1943 };
1944
1945 const XMLCh StatusCode::TOO_MANY_RESPONSES[] = //  urn:oasis:names:tc:SAML:2.0:status:TooManyResponses 
1946 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1947   chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1948   chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
1949   chLatin_s, chLatin_t, chLatin_a, chLatin_t, chLatin_u, chLatin_s, chColon,
1950   chLatin_T, chLatin_o, chLatin_o, chLatin_M, chLatin_a, chLatin_n, chLatin_y, 
1951     chLatin_R, chLatin_e, chLatin_s, chLatin_p, chLatin_o, chLatin_n, chLatin_s, chLatin_e, chLatin_s, chNull
1952 };
1953
1954 const XMLCh StatusCode::UNKNOWN_ATTR_PROFILE[] = //  urn:oasis:names:tc:SAML:2.0:status:UnknownAttrProfile 
1955 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1956   chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1957   chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
1958   chLatin_s, chLatin_t, chLatin_a, chLatin_t, chLatin_u, chLatin_s, chColon,
1959   chLatin_U, chLatin_n, chLatin_k, chLatin_n, chLatin_o, chLatin_w, chLatin_n, 
1960     chLatin_A, chLatin_t, chLatin_t, chLatin_r, 
1961     chLatin_P, chLatin_r, chLatin_o, chLatin_f, chLatin_i, chLatin_l, chLatin_e, chNull
1962 };
1963
1964 const XMLCh StatusCode::UNKNOWN_PRINCIPAL[] = //  urn:oasis:names:tc:SAML:2.0:status:UnknownPrincipal 
1965 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1966   chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1967   chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
1968   chLatin_s, chLatin_t, chLatin_a, chLatin_t, chLatin_u, chLatin_s, chColon,
1969   chLatin_U, chLatin_n, chLatin_k, chLatin_n, chLatin_o, chLatin_w, chLatin_n, 
1970     chLatin_P, chLatin_r, chLatin_i, chLatin_n, chLatin_c, chLatin_i, chLatin_p, chLatin_a, chLatin_l, chNull
1971 };
1972
1973 const XMLCh StatusCode::UNSUPPORTED_BINDING[] = //  urn:oasis:names:tc:SAML:2.0:status:UnsupportedBinding 
1974 { chLatin_u, chLatin_r, chLatin_n, chColon, chLatin_o, chLatin_a, chLatin_s, chLatin_i, chLatin_s, chColon,
1975   chLatin_n, chLatin_a, chLatin_m, chLatin_e, chLatin_s, chColon, chLatin_t, chLatin_c, chColon,
1976   chLatin_S, chLatin_A, chLatin_M, chLatin_L, chColon, chDigit_2, chPeriod, chDigit_0, chColon,
1977   chLatin_s, chLatin_t, chLatin_a, chLatin_t, chLatin_u, chLatin_s, chColon,
1978   chLatin_U, chLatin_n, chLatin_s, chLatin_u, chLatin_p, chLatin_p, chLatin_o, chLatin_r, chLatin_t, chLatin_e, chLatin_d, 
1979     chLatin_B, chLatin_i, chLatin_n, chLatin_d, chLatin_i, chLatin_n, chLatin_g, chNull
1980 };
1981