Exemple #1
0
 /**
  * Add this SPSSODescriptor to an EntityDescriptor.
  *
  * @param \DOMElement $parent The EntityDescriptor we should append this SPSSODescriptor to.
  * @return void
  */
 public function toXML(\DOMElement $parent)
 {
     assert('is_null($this->AuthnRequestsSigned) || is_bool($this->AuthnRequestsSigned)');
     assert('is_null($this->WantAssertionsSigned) || is_bool($this->WantAssertionsSigned)');
     assert('is_array($this->AssertionConsumerService)');
     assert('is_array($this->AttributeConsumingService)');
     $e = parent::toXML($parent);
     if ($this->AuthnRequestsSigned === true) {
         $e->setAttribute('AuthnRequestsSigned', 'true');
     } elseif ($this->AuthnRequestsSigned === false) {
         $e->setAttribute('AuthnRequestsSigned', 'false');
     }
     if ($this->WantAssertionsSigned === true) {
         $e->setAttribute('WantAssertionsSigned', 'true');
     } elseif ($this->WantAssertionsSigned === false) {
         $e->setAttribute('WantAssertionsSigned', 'false');
     }
     foreach ($this->AssertionConsumerService as $ep) {
         $ep->toXML($e, 'md:AssertionConsumerService');
     }
     foreach ($this->AttributeConsumingService as $acs) {
         $acs->toXML($e);
     }
 }
Exemple #2
0
 /**
  * Add this IDPSSODescriptor to an EntityDescriptor.
  *
  * @param \DOMElement $parent The EntityDescriptor we should append this IDPSSODescriptor to.
  * @return \DOMElement
  */
 public function toXML(\DOMElement $parent)
 {
     assert('is_null($this->WantAuthnRequestsSigned) || is_bool($this->WantAuthnRequestsSigned)');
     assert('is_array($this->SingleSignOnService)');
     assert('is_array($this->NameIDMappingService)');
     assert('is_array($this->AssertionIDRequestService)');
     assert('is_array($this->AttributeProfile)');
     assert('is_array($this->Attribute)');
     $e = parent::toXML($parent);
     if ($this->WantAuthnRequestsSigned === true) {
         $e->setAttribute('WantAuthnRequestsSigned', 'true');
     } elseif ($this->WantAuthnRequestsSigned === false) {
         $e->setAttribute('WantAuthnRequestsSigned', 'false');
     }
     foreach ($this->SingleSignOnService as $ep) {
         $ep->toXML($e, 'md:SingleSignOnService');
     }
     foreach ($this->NameIDMappingService as $ep) {
         $ep->toXML($e, 'md:NameIDMappingService');
     }
     foreach ($this->AssertionIDRequestService as $ep) {
         $ep->toXML($e, 'md:AssertionIDRequestService');
     }
     Utils::addStrings($e, Constants::NS_MD, 'md:AttributeProfile', false, $this->AttributeProfile);
     foreach ($this->Attribute as $a) {
         $a->toXML($e);
     }
     return $e;
 }