Skip to content

Commit

Permalink
Update to reflect upstream changes to the SOAP-lib
Browse files Browse the repository at this point in the history
  • Loading branch information
tvdijen committed Sep 16, 2024
1 parent a4f4cfa commit 9e6475d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
10 changes: 5 additions & 5 deletions src/Binding/SOAP.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
use SimpleSAML\SAML2\XML\samlp\AbstractMessage;
use SimpleSAML\SAML2\XML\samlp\MessageFactory;
use SimpleSAML\SAML2\XML\samlp\Response as SAML2_Response;
use SimpleSAML\SOAP11\Utils\XPath;
use SimpleSAML\SOAP11\XML\env\Body;
use SimpleSAML\SOAP11\XML\env\Envelope;
use SimpleSAML\SOAP11\XML\env\Header;
use SimpleSAML\SOAP\Utils\XPath;
use SimpleSAML\SOAP\XML\env_200106\Body;
use SimpleSAML\SOAP\XML\env_200106\Envelope;
use SimpleSAML\SOAP\XML\env_200106\Header;
use SimpleSAML\XML\DOMDocumentFactory;

use function file_get_contents;
Expand Down Expand Up @@ -100,7 +100,7 @@ public function receive(/** @scrutinizer ignore-unused */ServerRequestInterface

$xpCache = XPath::getXPath($document->documentElement);
/** @var \DOMElement[] $results */
$results = XPath::xpQuery($xml, '/env:Envelope/env:Body/*[1]', $xpCache);
$results = XPath::xpQuery($xml, '/SOAP-ENV:Envelope/SOAP-ENV:Body/*[1]', $xpCache);

return MessageFactory::fromXML($results[0]);
}
Expand Down
15 changes: 7 additions & 8 deletions tests/SAML2/Binding/SOAPTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,17 @@ public function testRequestParsing(): void
$issuer = 'https://ServiceProvider.com/SAML';

$stub = $this->getStubWithInput(<<<SOAP
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
<env:Body>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<samlp:ArtifactResolve
xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol"
xmlns="urn:oasis:names:tc:SAML:2.0:assertion"
Version="2.0" ID="{$id}"
IssueInstant="2004-01-21T19:00:49Z">
<Issuer>{$issuer}</Issuer>
<saml:Issuer xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion">{$issuer}</saml:Issuer>
<samlp:Artifact>{$artifact}</samlp:Artifact>
</samlp:ArtifactResolve>
</env:Body>
</env:Envelope>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
SOAP);

$request = new ServerRequest('', '');
Expand All @@ -83,7 +82,7 @@ public function testSendArtifactResponse(): void

$doc = DOMDocumentFactory::fromString(<<<SOAP
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"><env:Body /></env:Envelope>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body /></SOAP-ENV:Envelope>
SOAP);

/** @var \DOMElement $body */
Expand All @@ -108,7 +107,7 @@ public function testSendResponse(): void

$doc = DOMDocumentFactory::fromString(<<<SOAP
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"><env:Header /><env:Body /></env:Envelope>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Header /><SOAP-ENV:Body /></SOAP-ENV:Envelope>
SOAP);
$requestAuthenticated = new RequestAuthenticated(true);
$ecpResponse = new Response('https://example.org/metadata');
Expand Down

0 comments on commit 9e6475d

Please sign in to comment.