/*
- * Copyright 2001-2006 Internet2
+ * Copyright 2001-2007 Internet2
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
#include "saml1/core/Protocols.h"
#include <xmltooling/AbstractComplexElement.h>
-#include <xmltooling/AbstractElementProxy.h>
#include <xmltooling/AbstractSimpleElement.h>
#include <xmltooling/impl/AnyElement.h>
#include <xmltooling/io/AbstractXMLObjectMarshaller.h>
using namespace opensaml::saml1p;
using namespace opensaml::saml1;
-using namespace opensaml;
using namespace xmlsignature;
using namespace xmltooling;
using namespace std;
+using xmlconstants::XMLSIG_NS;
+using xmlconstants::XML_ONE;
+using samlconstants::SAML1P_NS;
+using samlconstants::SAML1_NS;
+using samlconstants::SAML1P_PREFIX;
#if defined (_MSC_VER)
#pragma warning( push )
protected:
void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
- PROC_TYPED_CHILD(Subject,SAMLConstants::SAML1_NS,true);
+ PROC_TYPED_CHILD(Subject,SAML1_NS,true);
AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
}
};
}
void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
- PROC_TYPED_CHILDREN(AttributeDesignator,SAMLConstants::SAML1_NS,true);
+ PROC_TYPED_CHILDREN(AttributeDesignator,SAML1_NS,true);
SubjectQueryImpl::processChildElement(childXMLObject,root);
}
}
void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
- PROC_TYPED_CHILD(Evidence,SAMLConstants::SAML1_NS,false);
- PROC_TYPED_CHILDREN(Action,SAMLConstants::SAML1_NS,false);
+ PROC_TYPED_CHILD(Evidence,SAML1_NS,false);
+ PROC_TYPED_CHILDREN(Action,SAML1_NS,false);
SubjectQueryImpl::processChildElement(childXMLObject,root);
}
pair<bool,int> v = getMinorVersion();
return (!v.first || v.second > 0) ? m_RequestID : NULL;
}
+ const XMLCh* getID() const {
+ return getRequestID();
+ }
IMPL_DATETIME_ATTRIB(IssueInstant,0);
IMPL_TYPED_CHILDREN(RespondWith,m_pos_Signature);
protected:
void marshallAttributes(DOMElement* domElement) const {
static const XMLCh MAJORVERSION[] = UNICODE_LITERAL_12(M,a,j,o,r,V,e,r,s,i,o,n);
- domElement->setAttributeNS(NULL,MAJORVERSION,XMLConstants::XML_ONE);
+ domElement->setAttributeNS(NULL,MAJORVERSION,XML_ONE);
if (!m_MinorVersion)
- const_cast<RequestAbstractTypeImpl*>(this)->m_MinorVersion=XMLString::replicate(XMLConstants::XML_ONE);
+ const_cast<RequestAbstractTypeImpl*>(this)->m_MinorVersion=XMLString::replicate(XML_ONE);
MARSHALL_INTEGER_ATTRIB(MinorVersion,MINORVERSION,NULL);
if (!m_RequestID)
const_cast<RequestAbstractTypeImpl*>(this)->m_RequestID=SAMLConfig::getConfig().generateIdentifier();
}
void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
- PROC_TYPED_CHILDREN(RespondWith,SAMLConstants::SAML1P_NS,false);
- PROC_TYPED_CHILD(Signature,XMLConstants::XMLSIG_NS,false);
+ PROC_TYPED_CHILDREN(RespondWith,SAML1P_NS,false);
+ PROC_TYPED_CHILD(Signature,XMLSIG_NS,false);
AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
}
void processAttribute(const DOMAttr* attribute) {
static const XMLCh MAJORVERSION[] = UNICODE_LITERAL_12(M,a,j,o,r,V,e,r,s,i,o,n);
if (XMLHelper::isNodeNamed(attribute,NULL,MAJORVERSION)) {
- if (!XMLString::equals(attribute->getValue(),XMLConstants::XML_ONE))
+ if (!XMLString::equals(attribute->getValue(),XML_ONE))
throw UnmarshallingException("Request has invalid major version.");
}
PROC_INTEGER_ATTRIB(MinorVersion,MINORVERSION,NULL);
protected:
void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
- PROC_TYPED_CHILD(Query,SAMLConstants::SAML1P_NS,true);
- PROC_TYPED_CHILDREN(AssertionIDReference,SAMLConstants::SAML1_NS,false);
- PROC_TYPED_CHILDREN(AssertionArtifact,SAMLConstants::SAML1P_NS,false);
+ PROC_TYPED_CHILD(Query,SAML1P_NS,true);
+ PROC_TYPED_CHILDREN(AssertionIDReference,SAML1_NS,false);
+ PROC_TYPED_CHILDREN(AssertionArtifact,SAML1P_NS,false);
RequestAbstractTypeImpl::processChildElement(childXMLObject,root);
}
};
}
void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
- PROC_TYPED_CHILD(StatusCode,SAMLConstants::SAML1P_NS,true);
+ PROC_TYPED_CHILD(StatusCode,SAML1P_NS,true);
AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
}
StatusDetailImpl(const StatusDetailImpl& src)
: AbstractXMLObject(src), AbstractComplexElement(src), AbstractDOMCachingXMLObject(src) {
- VectorOf(XMLObject) v=getDetails();
- for (vector<XMLObject*>::const_iterator i=src.m_Details.begin(); i!=src.m_Details.end(); i++) {
- if (*i) {
- v.push_back((*i)->clone());
- }
- }
+ VectorOf(XMLObject) v=getUnknownXMLObjects();
+ for (vector<XMLObject*>::const_iterator i=src.m_UnknownXMLObjects.begin(); i!=src.m_UnknownXMLObjects.end(); ++i)
+ v.push_back((*i)->clone());
}
IMPL_XMLOBJECT_CLONE(StatusDetail);
- IMPL_XMLOBJECT_CHILDREN(Detail,m_children.end());
+ IMPL_XMLOBJECT_CHILDREN(UnknownXMLObject,m_children.end());
protected:
void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
- getDetails().push_back(childXMLObject);
+ getUnknownXMLObjects().push_back(childXMLObject);
}
};
protected:
void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
- PROC_TYPED_CHILD(StatusCode,SAMLConstants::SAML1P_NS,false);
- PROC_TYPED_CHILD(StatusMessage,SAMLConstants::SAML1P_NS,false);
- PROC_TYPED_CHILD(StatusDetail,SAMLConstants::SAML1P_NS,false);
+ PROC_TYPED_CHILD(StatusCode,SAML1P_NS,false);
+ PROC_TYPED_CHILD(StatusMessage,SAML1P_NS,false);
+ PROC_TYPED_CHILD(StatusDetail,SAML1P_NS,false);
AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
}
};
pair<bool,int> v = getMinorVersion();
return (!v.first || v.second > 0) ? m_ResponseID : NULL;
}
+ const XMLCh* getID() const {
+ return getResponseID();
+ }
IMPL_STRING_ATTRIB(InResponseTo);
IMPL_DATETIME_ATTRIB(IssueInstant,0);
IMPL_STRING_ATTRIB(Recipient);
protected:
void marshallAttributes(DOMElement* domElement) const {
static const XMLCh MAJORVERSION[] = UNICODE_LITERAL_12(M,a,j,o,r,V,e,r,s,i,o,n);
- domElement->setAttributeNS(NULL,MAJORVERSION,XMLConstants::XML_ONE);
+ domElement->setAttributeNS(NULL,MAJORVERSION,XML_ONE);
if (!m_MinorVersion)
- const_cast<ResponseAbstractTypeImpl*>(this)->m_MinorVersion=XMLString::replicate(XMLConstants::XML_ONE);
+ const_cast<ResponseAbstractTypeImpl*>(this)->m_MinorVersion=XMLString::replicate(XML_ONE);
MARSHALL_INTEGER_ATTRIB(MinorVersion,MINORVERSION,NULL);
if (!m_ResponseID)
const_cast<ResponseAbstractTypeImpl*>(this)->m_ResponseID=SAMLConfig::getConfig().generateIdentifier();
}
void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
- PROC_TYPED_CHILD(Signature,XMLConstants::XMLSIG_NS,false);
+ PROC_TYPED_CHILD(Signature,XMLSIG_NS,false);
AbstractXMLObjectUnmarshaller::processChildElement(childXMLObject,root);
}
void processAttribute(const DOMAttr* attribute) {
static const XMLCh MAJORVERSION[] = UNICODE_LITERAL_12(M,a,j,o,r,V,e,r,s,i,o,n);
if (XMLHelper::isNodeNamed(attribute,NULL,MAJORVERSION)) {
- if (!XMLString::equals(attribute->getValue(),XMLConstants::XML_ONE))
+ if (!XMLString::equals(attribute->getValue(),XML_ONE))
throw UnmarshallingException("Response has invalid major version.");
}
PROC_INTEGER_ATTRIB(MinorVersion,MINORVERSION,NULL);
init();
if (src.getStatus())
setStatus(src.getStatus()->cloneStatus());
- VectorOf(Assertion) v=getAssertions();
- for (vector<Assertion*>::const_iterator i=src.m_Assertions.begin(); i!=src.m_Assertions.end(); i++) {
+ VectorOf(saml1::Assertion) v=getAssertions();
+ for (vector<saml1::Assertion*>::const_iterator i=src.m_Assertions.begin(); i!=src.m_Assertions.end(); i++) {
if (*i) {
v.push_back((*i)->cloneAssertion());
}
return cloneResponse();
}
IMPL_TYPED_CHILD(Status);
- IMPL_TYPED_CHILDREN(Assertion, m_children.end());
+ IMPL_TYPED_FOREIGN_CHILDREN(Assertion,saml1,m_children.end());
protected:
void processChildElement(XMLObject* childXMLObject, const DOMElement* root) {
- PROC_TYPED_CHILD(Status,SAMLConstants::SAML1P_NS,false);
- PROC_TYPED_CHILDREN(Assertion,SAMLConstants::SAML1_NS,true);
+ PROC_TYPED_CHILD(Status,SAML1P_NS,false);
+ PROC_TYPED_FOREIGN_CHILDREN(Assertion,saml1,SAML1_NS,true);
ResponseAbstractTypeImpl::processChildElement(childXMLObject,root);
}
};
const XMLCh _RESPONDER[] = UNICODE_LITERAL_9(R,e,s,p,o,n,d,e,r);
const XMLCh _VERSIONMISMATCH[] = UNICODE_LITERAL_15(V,e,r,s,i,o,n,M,i,s,m,a,t,c,h);
-QName StatusCode::SUCCESS(SAMLConstants::SAML1P_NS,_SUCCESS,SAMLConstants::SAML1P_PREFIX);
-QName StatusCode::REQUESTER(SAMLConstants::SAML1P_NS,_REQUESTER,SAMLConstants::SAML1P_PREFIX);
-QName StatusCode::RESPONDER(SAMLConstants::SAML1P_NS,_RESPONDER,SAMLConstants::SAML1P_PREFIX);
-QName StatusCode::VERSIONMISMATCH(SAMLConstants::SAML1P_NS,_VERSIONMISMATCH,SAMLConstants::SAML1P_PREFIX);
+QName StatusCode::SUCCESS(SAML1P_NS,_SUCCESS,SAML1P_PREFIX);
+QName StatusCode::REQUESTER(SAML1P_NS,_REQUESTER,SAML1P_PREFIX);
+QName StatusCode::RESPONDER(SAML1P_NS,_RESPONDER,SAML1P_PREFIX);
+QName StatusCode::VERSIONMISMATCH(SAML1P_NS,_VERSIONMISMATCH,SAML1P_PREFIX);