-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,12 +9,14 @@ | |
use Soap\Wsdl\Exception\UnloadableWsdlException; | ||
use Soap\Wsdl\Loader\Context\FlatteningContext; | ||
use Soap\Wsdl\Uri\IncludePathBuilder; | ||
use Soap\Xml\Xmlns; | ||
use Soap\Xml\Xpath\WsdlPreset; | ||
use VeeWee\Xml\Dom\Configurator\Configurator; | ||
use VeeWee\Xml\Dom\Document; | ||
use VeeWee\Xml\Exception\RuntimeException; | ||
use function VeeWee\Xml\Dom\Locator\document_element; | ||
use function VeeWee\Xml\Dom\Locator\Node\children; | ||
use function VeeWee\Xml\Dom\Manipulator\Node\append_external_node; | ||
use function VeeWee\Xml\Dom\Manipulator\Node\remove; | ||
use function VeeWee\Xml\Dom\Manipulator\Node\replace_by_external_nodes; | ||
|
||
|
@@ -66,11 +68,28 @@ private function importWsdlImportElement(DOMElement $import): void | |
} | ||
|
||
$imported = Document::fromXmlString($result); | ||
$definitions = $imported->map(document_element()); | ||
|
||
// A wsdl:import can be either a WSDL or an XSD file: | ||
match ($imported->locateDocumentElement()->namespaceURI) { | ||
Xmlns::xsd()->value() => $this->importXsdPart($import, $imported), | ||
default => $this->importWsdlPart($import, $imported), | ||
}; | ||
} | ||
|
||
private function importWsdlPart(DOMElement $importElement, Document $importedDocument): void | ||
{ | ||
$definitions = $importedDocument->map(document_element()); | ||
|
||
replace_by_external_nodes( | ||
Check failure on line 83 in src/Xml/Configurator/FlattenWsdlImports.php GitHub Actions / PHP 8.1 @ ubuntu-latestMissingThrowsDocblock
Check failure on line 83 in src/Xml/Configurator/FlattenWsdlImports.php GitHub Actions / PHP 8.2 @ ubuntu-latestMissingThrowsDocblock
Check failure on line 83 in src/Xml/Configurator/FlattenWsdlImports.php GitHub Actions / PHP 8.3 @ ubuntu-latestMissingThrowsDocblock
|
||
$import, | ||
$importElement, | ||
children($definitions) | ||
); | ||
} | ||
|
||
private function importXsdPart(DOMElement $importElement, Document $importedDocument): void | ||
{ | ||
$types = $this->context->types(); | ||
Check failure on line 91 in src/Xml/Configurator/FlattenWsdlImports.php GitHub Actions / PHP 8.1 @ ubuntu-latestMissingThrowsDocblock
Check failure on line 91 in src/Xml/Configurator/FlattenWsdlImports.php GitHub Actions / PHP 8.2 @ ubuntu-latestMissingThrowsDocblock
Check failure on line 91 in src/Xml/Configurator/FlattenWsdlImports.php GitHub Actions / PHP 8.3 @ ubuntu-latestMissingThrowsDocblock
|
||
remove($importElement); | ||
Check failure on line 92 in src/Xml/Configurator/FlattenWsdlImports.php GitHub Actions / PHP 8.1 @ ubuntu-latestMissingThrowsDocblock
Check failure on line 92 in src/Xml/Configurator/FlattenWsdlImports.php GitHub Actions / PHP 8.2 @ ubuntu-latestMissingThrowsDocblock
Check failure on line 92 in src/Xml/Configurator/FlattenWsdlImports.php GitHub Actions / PHP 8.3 @ ubuntu-latestMissingThrowsDocblock
|
||
append_external_node($types, $importedDocument->locateDocumentElement()); | ||
Check failure on line 93 in src/Xml/Configurator/FlattenWsdlImports.php GitHub Actions / PHP 8.1 @ ubuntu-latestMissingThrowsDocblock
Check failure on line 93 in src/Xml/Configurator/FlattenWsdlImports.php GitHub Actions / PHP 8.2 @ ubuntu-latestMissingThrowsDocblock
Check failure on line 93 in src/Xml/Configurator/FlattenWsdlImports.php GitHub Actions / PHP 8.3 @ ubuntu-latestMissingThrowsDocblock
|
||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?xml version="1.0"?> | ||
<definitions | ||
xmlns="http://schemas.xmlsoap.org/wsdl/" | ||
xmlns:tns="http://soapinterop.org/" | ||
targetNamespace="http://soapinterop.org/"> | ||
<import namespace="http://soapinterop.org/store1" location="xsd/store1.xsd" /> | ||
<import namespace="http://soapinterop.org/store2" location="xsd/store2.xsd" /> | ||
</definitions> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?xml version="1.0"?> | ||
<definitions | ||
xmlns="http://schemas.xmlsoap.org/wsdl/" | ||
xmlns:tns="http://soapinterop.org/" | ||
targetNamespace="http://soapinterop.org/"> | ||
<import namespace="http://soapinterop.org/store1" location="xsd/store1.xsd" /> | ||
</definitions> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?xml version="1.0"?> | ||
<definitions | ||
xmlns="http://schemas.xmlsoap.org/wsdl/" | ||
xmlns:tns="http://soapinterop.org/" | ||
targetNamespace="http://soapinterop.org/"> | ||
<types> | ||
<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://soapinterop.org/store1"> | ||
<xsd:complexType name="Store"> | ||
<xsd:sequence> | ||
<element minOccurs="1" maxOccurs="1" name="Attribute1" type="string"/> | ||
</xsd:sequence> | ||
</xsd:complexType> | ||
</schema> | ||
<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://soapinterop.org/store2"> | ||
<xsd:complexType name="Store"> | ||
<xsd:sequence> | ||
<element minOccurs="1" maxOccurs="1" name="Attribute2" type="string"/> | ||
</xsd:sequence> | ||
</xsd:complexType> | ||
</schema> | ||
</types> | ||
</definitions> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?xml version="1.0"?> | ||
<definitions | ||
xmlns="http://schemas.xmlsoap.org/wsdl/" | ||
xmlns:tns="http://soapinterop.org/" | ||
targetNamespace="http://soapinterop.org/"> | ||
<types> | ||
<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://soapinterop.org/store1"> | ||
<xsd:complexType name="Store"> | ||
<xsd:sequence> | ||
<element minOccurs="1" maxOccurs="1" name="Attribute1" type="string"/> | ||
</xsd:sequence> | ||
</xsd:complexType> | ||
</schema> | ||
</types> | ||
</definitions> |