Skip to content

Commit 50057ab

Browse files
committed
Use SOAP XPath from lib
1 parent 91edb1f commit 50057ab

4 files changed

Lines changed: 5 additions & 6 deletions

File tree

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"psr/log": "^2.0 || ^3.0",
3232
"simplesamlphp/xml-common": "^1.7.0",
3333
"simplesamlphp/xml-security": "^1.6.0",
34-
"simplesamlphp/xml-soap": "^1.0.2",
34+
"simplesamlphp/xml-soap": "^1.1.0",
3535
"simplesamlphp/assert": "^1.0.3"
3636
},
3737
"require-dev": {

src/SAML2/SOAP.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
use Psr\Http\Message\ServerRequestInterface;
1212
use SimpleSAML\SAML2\Exception\Protocol\UnsupportedBindingException;
1313
use SimpleSAML\SAML2\Utils;
14-
use SimpleSAML\SAML2\Utils\XPath;
14+
use SimpleSAML\SOAP11\Utils\XPath;
1515
use SimpleSAML\SAML2\XML\ecp\Response as ECPResponse;
1616
use SimpleSAML\SAML2\XML\ecp\RequestAuthenticated;
1717
use SimpleSAML\SAML2\XML\samlp\AbstractMessage;
@@ -103,7 +103,7 @@ public function receive(/** @scrutinizer ignore-unused */ServerRequestInterface
103103

104104
$xpCache = XPath::getXPath($document->documentElement);
105105
/** @var \DOMElement[] $results */
106-
$results = XPath::xpQuery($xml, '/soap-env:Envelope/soap-env:Body/*[1]', $xpCache);
106+
$results = XPath::xpQuery($xml, '/env:Envelope/env:Body/*[1]', $xpCache);
107107

108108
return MessageFactory::fromXML($results[0]);
109109
}

src/SAML2/SOAPClient.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
use SimpleSAML\SAML2\Compat\ContainerSingleton;
1111
use SimpleSAML\SAML2\Exception\InvalidArgumentException;
1212
use SimpleSAML\SAML2\Exception\RuntimeException;
13-
use SimpleSAML\SAML2\Utils\XPath;
1413
use SimpleSAML\SAML2\XML\samlp\AbstractMessage;
1514
use SimpleSAML\SAML2\XML\samlp\MessageFactory;
15+
use SimpleSAML\SOAP11\Utils\XPath;
1616
use SimpleSAML\SOAP11\XML\env\Body;
1717
use SimpleSAML\SOAP11\XML\env\Envelope;
1818
use SimpleSAML\SOAP11\XML\env\Fault;
@@ -263,7 +263,7 @@ private function getSOAPFault(DOMDocument $soapMessage): ?Fault
263263
/** @psalm-suppress PossiblyNullArgument */
264264
$soapFault = XPath::xpQuery(
265265
$soapMessage->firstChild,
266-
'/soap-env:Envelope/soap-env:Body/soap-env:Fault',
266+
'/env:Envelope/env:Body/env:Fault',
267267
XPath::getXPath($soapMessage->firstChild),
268268
);
269269

src/SAML2/Utils/XPath.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ class XPath extends \SimpleSAML\XMLSecurity\Utils\XPath
2626
public static function getXPath(DOMNode $node): DOMXPath
2727
{
2828
$xp = parent::getXPath($node);
29-
$xp->registerNamespace('soap-env', C::NS_SOAP);
3029
$xp->registerNamespace('saml_protocol', C::NS_SAMLP);
3130
$xp->registerNamespace('saml_assertion', C::NS_SAML);
3231
$xp->registerNamespace('saml_metadata', C::NS_MD);

0 commit comments

Comments
 (0)