From 5b4f19d032ffbf48e292c73efdf16794cbb347ff Mon Sep 17 00:00:00 2001 From: Christian Scheb Date: Tue, 31 Jul 2012 16:57:35 +0200 Subject: [PATCH 1/2] Schemas should only included when there is a "schemaLocation" attribute --- src/BeSimple/SoapClient/WsdlDownloader.php | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/BeSimple/SoapClient/WsdlDownloader.php b/src/BeSimple/SoapClient/WsdlDownloader.php index 453eaba..79e8423 100644 --- a/src/BeSimple/SoapClient/WsdlDownloader.php +++ b/src/BeSimple/SoapClient/WsdlDownloader.php @@ -189,14 +189,16 @@ class WsdlDownloader $nodes = $xpath->query($query); if ($nodes->length > 0) { foreach ($nodes as $node) { - $schemaLocation = $node->getAttribute('schemaLocation'); - if ($this->isRemoteFile($schemaLocation)) { - $schemaLocation = $this->download($schemaLocation); - $node->setAttribute('schemaLocation', $schemaLocation); - } elseif (!is_null($parentFile)) { - $schemaLocation = $this->resolveRelativePathInUrl($parentFile, $schemaLocation); - $schemaLocation = $this->download($schemaLocation); - $node->setAttribute('schemaLocation', $schemaLocation); + if ( $node->hasAttribute('schemaLocation') ) { + $schemaLocation = $node->getAttribute('schemaLocation'); + if ($this->isRemoteFile($schemaLocation)) { + $schemaLocation = $this->download($schemaLocation); + $node->setAttribute('schemaLocation', $schemaLocation); + } elseif (!is_null($parentFile)) { + $schemaLocation = $this->resolveRelativePathInUrl($parentFile, $schemaLocation); + $schemaLocation = $this->download($schemaLocation); + $node->setAttribute('schemaLocation', $schemaLocation); + } } } } From 2a82f02db34d09478847845e7fd55e1048ec219b Mon Sep 17 00:00:00 2001 From: Christian Scheb Date: Thu, 2 Aug 2012 10:13:49 +0200 Subject: [PATCH 2/2] Code formating changes --- src/BeSimple/SoapClient/WsdlDownloader.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/BeSimple/SoapClient/WsdlDownloader.php b/src/BeSimple/SoapClient/WsdlDownloader.php index 79e8423..9f62fe4 100644 --- a/src/BeSimple/SoapClient/WsdlDownloader.php +++ b/src/BeSimple/SoapClient/WsdlDownloader.php @@ -189,12 +189,12 @@ class WsdlDownloader $nodes = $xpath->query($query); if ($nodes->length > 0) { foreach ($nodes as $node) { - if ( $node->hasAttribute('schemaLocation') ) { + if ($node->hasAttribute('schemaLocation')) { $schemaLocation = $node->getAttribute('schemaLocation'); if ($this->isRemoteFile($schemaLocation)) { $schemaLocation = $this->download($schemaLocation); $node->setAttribute('schemaLocation', $schemaLocation); - } elseif (!is_null($parentFile)) { + } elseif (null !== $parentFile) { $schemaLocation = $this->resolveRelativePathInUrl($parentFile, $schemaLocation); $schemaLocation = $this->download($schemaLocation); $node->setAttribute('schemaLocation', $schemaLocation);