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