ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
SAML2\XML\ecp\Response Class Reference

Class representing the ECP Response element. More...

+ Collaboration diagram for SAML2\XML\ecp\Response:

Public Member Functions

 __construct (DOMElement $xml=null)
 Create a ECP Response element. More...
 
 toXML (DOMElement $parent)
 Convert this ECP Response to XML. More...
 

Data Fields

 $AssertionConsumerServiceURL
 

Detailed Description

Class representing the ECP Response element.

Definition at line 13 of file Response.php.

Constructor & Destructor Documentation

◆ __construct()

SAML2\XML\ecp\Response::__construct ( DOMElement  $xml = null)

Create a ECP Response element.

Parameters
DOMElement | null$xmlThe XML element we should load.

Definition at line 27 of file Response.php.

References $xml, and SAML2\Constants\NS_SOAP.

28  {
29  if ($xml === null) {
30  return;
31  }
32 
33  if (!$xml->hasAttributeNS(Constants::NS_SOAP, 'mustUnderstand')) {
34  throw new Exception('Missing SOAP-ENV:mustUnderstand attribute in <ecp:Response>.');
35  }
36  if ($xml->getAttributeNS(Constants::NS_SOAP, 'mustUnderstand') !== '1') {
37  throw new Exception('Invalid value of SOAP-ENV:mustUnderstand attribute in <ecp:Response>.');
38  }
39 
40  if (!$xml->hasAttributeNS(Constants::NS_SOAP, 'actor')) {
41  throw new Exception('Missing SOAP-ENV:actor attribute in <ecp:Response>.');
42  }
43  if ($xml->getAttributeNS(Constants::NS_SOAP, 'actor') !== 'http://schemas.xmlsoap.org/soap/actor/next') {
44  throw new Exception('Invalid value of SOAP-ENV:actor attribute in <ecp:Response>.');
45  }
46 
47  if (!$xml->hasAttribute('AssertionConsumerServiceURL')) {
48  throw new Exception('Missing AssertionConsumerServiceURL attribute in <ecp:Response>.');
49  }
50 
51  $this->AssertionConsumerServiceURL = $xml->getAttribute('AssertionConsumerServiceURL');
52  }
const NS_SOAP
The namespace for the SOAP protocol.
Definition: Constants.php:215

Member Function Documentation

◆ toXML()

SAML2\XML\ecp\Response::toXML ( DOMElement  $parent)

Convert this ECP Response to XML.

Parameters
DOMElement$parentThe element we should append this element to.

Definition at line 58 of file Response.php.

References $response, SAML2\Constants\NS_ECP, and SAML2\Constants\NS_SOAP.

59  {
60  if (!is_string($this->AssertionConsumerServiceURL)) {
61  throw new InvalidArgumentException("AssertionConsumerServiceURL must be a string");
62  }
63 
64  $doc = $parent->ownerDocument;
65  $response = $doc->createElementNS(Constants::NS_ECP, 'ecp:Response');
66 
67  $parent->appendChild($response);
68 
69  $response->setAttributeNS(Constants::NS_SOAP, 'SOAP-ENV:mustUnderstand', '1');
70  $response->setAttributeNS(Constants::NS_SOAP, 'SOAP-ENV:actor', 'http://schemas.xmlsoap.org/soap/actor/next');
71  $response->setAttribute('AssertionConsumerServiceURL', $this->AssertionConsumerServiceURL);
72 
73  return $response;
74  }
const NS_SOAP
The namespace for the SOAP protocol.
Definition: Constants.php:215
const NS_ECP
The namespace for the ECP protocol.
Definition: Constants.php:210
$response

Field Documentation

◆ $AssertionConsumerServiceURL

SAML2\XML\ecp\Response::$AssertionConsumerServiceURL

Definition at line 20 of file Response.php.


The documentation for this class was generated from the following file: