From 91f02038d18d10909dde6b52637efdc750e6cba1 Mon Sep 17 00:00:00 2001 From: Toon Verwerft Date: Fri, 26 Jul 2024 14:44:15 +0200 Subject: [PATCH] Force known schema to be a file instead of relatively resolving it from the base URI --- src/Parser/Context/ParserContext.php | 2 +- src/Parser/Definitions/SchemaParser.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Parser/Context/ParserContext.php b/src/Parser/Context/ParserContext.php index 7fa42ce..b2c13a9 100644 --- a/src/Parser/Context/ParserContext.php +++ b/src/Parser/Context/ParserContext.php @@ -8,7 +8,7 @@ final class ParserContext { /** - * @param array $knownSchemas - A dictionary of the xml namespace and a known XSD file. + * @param array $knownSchemas - A dictionary of the xml namespace and a locally known XSD file. */ public function __construct( public array $knownSchemas, diff --git a/src/Parser/Definitions/SchemaParser.php b/src/Parser/Definitions/SchemaParser.php index f5e9507..3d8c2a6 100644 --- a/src/Parser/Definitions/SchemaParser.php +++ b/src/Parser/Definitions/SchemaParser.php @@ -33,7 +33,7 @@ public static function tryParse(Document $wsdl, ParserContext $context): Schema // Since WSDLs don't require the soap specific schema's to be imported. $globalSchema = $reader->getGlobalSchema(); foreach ($context->knownSchemas as $namespace => $location) { - $reader->addKnownNamespaceSchemaLocation($namespace, $location); + $reader->addKnownNamespaceSchemaLocation($namespace, 'file://'.$location); $globalSchema->addSchema( $reader->readNode(Document::fromXmlFile($location)->locate(document_element()), $namespace) );