From 491d5f1ab168e29daf8e3f98c654ec0ecbc3db63 Mon Sep 17 00:00:00 2001 From: Francis Besset Date: Tue, 23 Jul 2013 18:06:44 +0200 Subject: [PATCH] [SoapBundle] Removed the first char if the ComplexType start with `\` Fixed issue https://github.com/BeSimple/BeSimpleSoapBundle/issues/59 --- .../ServiceDefinition/Dumper/Wsdl.php | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/BeSimple/SoapBundle/ServiceDefinition/Dumper/Wsdl.php b/src/BeSimple/SoapBundle/ServiceDefinition/Dumper/Wsdl.php index 455d382..e8e4721 100644 --- a/src/BeSimple/SoapBundle/ServiceDefinition/Dumper/Wsdl.php +++ b/src/BeSimple/SoapBundle/ServiceDefinition/Dumper/Wsdl.php @@ -31,12 +31,18 @@ class Wsdl extends BaseWsdl public function getType($type) { if ($type instanceof Type) { - $xmlType = $type->getXmlType(); - } else { - $xmlType = $this->typeRepository->getXmlTypeMapping($type); + return $type->getXmlType(); } - return $xmlType ?: $this->addComplexType($type); + if ('\\' === $type[0]) { + $type = substr($type, 1); + } + + if (!$xmlType = $this->typeRepository->getXmlTypeMapping($type)) { + $xmlType = $this->addComplexType($type); + } + + return $xmlType; } /** @@ -51,10 +57,6 @@ class Wsdl extends BaseWsdl return $this->classMap[$type]; } - if ($type[0] == '\\') { - $type = substr($type, 1); - } - return str_replace('\\', '.', $type); } @@ -75,4 +77,4 @@ class Wsdl extends BaseWsdl return $bindingOperation; } -} \ No newline at end of file +}