From be1e80799c063a787dc44ec13722f98b75ecdac8 Mon Sep 17 00:00:00 2001 From: Francis Besset Date: Mon, 22 Jul 2013 15:50:28 +0200 Subject: [PATCH 1/7] [SoapBundle] Added services_classmap node configuration --- .../DependencyInjection/BeSimpleSoapExtension.php | 5 +++++ .../SoapBundle/DependencyInjection/Configuration.php | 9 +++++++++ 2 files changed, 14 insertions(+) diff --git a/src/BeSimple/SoapBundle/DependencyInjection/BeSimpleSoapExtension.php b/src/BeSimple/SoapBundle/DependencyInjection/BeSimpleSoapExtension.php index 941cbf0..45e5603 100644 --- a/src/BeSimple/SoapBundle/DependencyInjection/BeSimpleSoapExtension.php +++ b/src/BeSimple/SoapBundle/DependencyInjection/BeSimpleSoapExtension.php @@ -57,6 +57,11 @@ class BeSimpleSoapExtension extends Extension $container->setParameter('besimple.soap.definition.dumper.options.stylesheet', $config['wsdl_dumper']['stylesheet']); + $container + ->getDefinition('besimple.soap.server.classmap') + ->addMethodCall('set', array($config['services_classmap'])) + ; + foreach($config['services'] as $name => $serviceConfig) { $serviceConfig['name'] = $name; $this->createWebServiceContext($serviceConfig, $container); diff --git a/src/BeSimple/SoapBundle/DependencyInjection/Configuration.php b/src/BeSimple/SoapBundle/DependencyInjection/Configuration.php index f7fa94d..76c9809 100644 --- a/src/BeSimple/SoapBundle/DependencyInjection/Configuration.php +++ b/src/BeSimple/SoapBundle/DependencyInjection/Configuration.php @@ -97,6 +97,8 @@ class Configuration { $rootNode ->children() + + // "services" section ->arrayNode('services') ->useAttributeAsKey('name') ->prototype('array') @@ -120,6 +122,13 @@ class Configuration ->end() ->end() ->end() + + // "services_classmap" section + ->arrayNode('services_classmap') + ->useAttributeAsKey('name') + ->prototype('scalar')->end() + ->end() + ->end() ->end() ; } From 04a94bbbe42efcc2f015c3d269c1c754dc6c651c Mon Sep 17 00:00:00 2001 From: Francis Besset Date: Mon, 22 Jul 2013 15:51:45 +0200 Subject: [PATCH 2/7] [SoapBundle] Updated ComplexType strategy --- .../ServiceDefinition/ServiceDefinition.php | 13 ++++- .../Strategy/ComplexType.php | 57 ++++++++++++------- 2 files changed, 48 insertions(+), 22 deletions(-) diff --git a/src/BeSimple/SoapBundle/ServiceDefinition/ServiceDefinition.php b/src/BeSimple/SoapBundle/ServiceDefinition/ServiceDefinition.php index 458f23d..b748c4b 100644 --- a/src/BeSimple/SoapBundle/ServiceDefinition/ServiceDefinition.php +++ b/src/BeSimple/SoapBundle/ServiceDefinition/ServiceDefinition.php @@ -128,13 +128,24 @@ class ServiceDefinition $this->classmap = $classmap; } + public function hasDefinitionComplexType($type) + { + return isset($this->complexTypes[$type]); + } + public function addDefinitionComplexType($type, Collection $complexType) { + if ($this->hasDefinitionComplexType($type)) { + return false; + } + $this->complexTypes[$type] = $complexType; + + return true; } public function getDefinitionComplexTypes() { return $this->complexTypes; } -} \ No newline at end of file +} diff --git a/src/BeSimple/SoapBundle/ServiceDefinition/Strategy/ComplexType.php b/src/BeSimple/SoapBundle/ServiceDefinition/Strategy/ComplexType.php index c8df45f..6be1228 100644 --- a/src/BeSimple/SoapBundle/ServiceDefinition/Strategy/ComplexType.php +++ b/src/BeSimple/SoapBundle/ServiceDefinition/Strategy/ComplexType.php @@ -38,40 +38,53 @@ class ComplexType extends AbstractComplexTypeStrategy */ public function addComplexType($type) { - $classmap = $this->definition->getClassmap(); - + // Really needed? if (null !== $soapType = $this->scanRegisteredTypes($type)) { return $soapType; } - if (!$this->loader->supports($type)) { - throw new \InvalidArgumentException(sprintf('Cannot add a complex type "%s" that is not an object or where class could not be found in "ComplexType" strategy.', $type)); + $classmap = $this->definition->getClassmap(); + if ($classmap->has($type)) { + $xmlName = $classmap->get($type); + $this->addDefinition($type, $xmlName); + + $xmlType = 'tns:'.$xmlName; + } else { + if (!$this->loader->supports($type)) { + throw new \InvalidArgumentException(sprintf('Cannot add a complex type "%s" that is not an object or where class could not be found in "ComplexType" strategy.', $type)); + } + + $xmlName = $this->getContext()->translateType($type); + $xmlType = 'tns:'.$xmlName; + + // Register type here to avoid recursion + $classmap->add($type, $xmlName); + $this->getContext()->addType($type, $soapType); + } + + $this->addDefinition($type, $xmlName); + + return $xmlType; + } + + private function addDefinition($type, $xmlName) + { + if ($this->definition->hasDefinitionComplexType($type)) { + return false; } $dom = $this->getContext()->toDomDocument(); - - $soapTypeName = $this->getContext()->translateType($type); - $soapType = 'tns:'.$soapTypeName; - - if (!$classmap->has($soapTypeName)) { - $classmap->add($soapTypeName, $type); - } - - // Register type here to avoid recursion - $this->getContext()->addType($type, $soapType); - $complexType = $dom->createElement('xsd:complexType'); - $complexType->setAttribute('name', $soapTypeName); + $complexType->setAttribute('name', $xmlName); $all = $dom->createElement('xsd:all'); + $elements = array(); $definitionComplexType = $this->loader->load($type); - $this->definition->addDefinitionComplexType($type, $definitionComplexType); - foreach ($definitionComplexType as $annotationComplexType) { $element = $dom->createElement('xsd:element'); - $element->setAttribute('name', $propertyName = $annotationComplexType->getName()); - $element->setAttribute('type', $this->getContext()->getType(trim($annotationComplexType->getValue()))); + $element->setAttribute('name', $annotationComplexType->getName()); + $element->setAttribute('type', $this->getContext()->getType($annotationComplexType->getValue())); if ($annotationComplexType->isNillable()) { $element->setAttribute('nillable', 'true'); @@ -83,6 +96,8 @@ class ComplexType extends AbstractComplexTypeStrategy $complexType->appendChild($all); $this->getContext()->getSchema()->appendChild($complexType); - return $soapType; + $this->definition->addDefinitionComplexType($type, $definitionComplexType); + + return true; } } From 16dddc0da69cec5d4aa5e604132763a86fbb988f Mon Sep 17 00:00:00 2001 From: Francis Besset Date: Mon, 22 Jul 2013 20:34:02 +0200 Subject: [PATCH 3/7] [SoapServer] Added Classmap class to find Type by Classname --- src/BeSimple/SoapServer/Classmap.php | 47 ++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 src/BeSimple/SoapServer/Classmap.php diff --git a/src/BeSimple/SoapServer/Classmap.php b/src/BeSimple/SoapServer/Classmap.php new file mode 100644 index 0000000..aa1e3e9 --- /dev/null +++ b/src/BeSimple/SoapServer/Classmap.php @@ -0,0 +1,47 @@ + + * (c) Francis Besset + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +namespace BeSimple\SoapServer; + +use BeSimple\SoapCommon\Classmap as BaseClassmap; + +/** + * @author Francis Besset + */ +class Classmap extends BaseClassmap +{ + protected $classmapInversed = array(); + + /** + * {@inheritdoc} + */ + public function add($type, $classname) + { + parent::add($type, $classname); + + $this->classmapInversed[$classname] = $type; + } + + public function getByClassname($classname) + { + if (!$this->hasByClassname($classname)) { + throw new \InvalidArgumentException(sprintf('The classname "%s" was not found in %s', $classname, __CLASS__)); + } + + return $this->classmapInversed[$classname]; + } + + public function hasByClassname($classname) + { + return isset($this->classmapInversed[$classname]); + } +} From 6de878de7d7ae4a916258fdf79374c6720ff6d08 Mon Sep 17 00:00:00 2001 From: Francis Besset Date: Mon, 22 Jul 2013 20:34:25 +0200 Subject: [PATCH 4/7] [SoapBundle] Fixed ComplexType strategy to find Type by Classname --- .../Resources/config/webservice.xml | 2 +- .../Strategy/ComplexType.php | 35 +++++++++---------- 2 files changed, 18 insertions(+), 19 deletions(-) diff --git a/src/BeSimple/SoapBundle/Resources/config/webservice.xml b/src/BeSimple/SoapBundle/Resources/config/webservice.xml index 122cd86..cd1a689 100644 --- a/src/BeSimple/SoapBundle/Resources/config/webservice.xml +++ b/src/BeSimple/SoapBundle/Resources/config/webservice.xml @@ -15,7 +15,7 @@ BeSimple\SoapBundle\ServiceBinding\DocumentLiteralWrappedResponseMessageBinder BeSimple\SoapBundle\ServiceDefinition\Dumper\WsdlDumper BeSimple\SoapBundle\Converter\TypeRepository - BeSimple\SoapCommon\Classmap + BeSimple\SoapServer\Classmap diff --git a/src/BeSimple/SoapBundle/ServiceDefinition/Strategy/ComplexType.php b/src/BeSimple/SoapBundle/ServiceDefinition/Strategy/ComplexType.php index 6be1228..0e0b579 100644 --- a/src/BeSimple/SoapBundle/ServiceDefinition/Strategy/ComplexType.php +++ b/src/BeSimple/SoapBundle/ServiceDefinition/Strategy/ComplexType.php @@ -36,51 +36,50 @@ class ComplexType extends AbstractComplexTypeStrategy * @param string $type Name of the class to be specified * @return string XSD Type for the given PHP type */ - public function addComplexType($type) + public function addComplexType($classname) { // Really needed? - if (null !== $soapType = $this->scanRegisteredTypes($type)) { - return $soapType; + if (null !== $type = $this->scanRegisteredTypes($classname)) { + return $type; } $classmap = $this->definition->getClassmap(); - if ($classmap->has($type)) { - $xmlName = $classmap->get($type); - $this->addDefinition($type, $xmlName); + if ($classmap->hasByClassname($classname)) { + $type = $classmap->getByClassname($classname); - $xmlType = 'tns:'.$xmlName; + $xmlType = 'tns:'.$type; } else { - if (!$this->loader->supports($type)) { - throw new \InvalidArgumentException(sprintf('Cannot add a complex type "%s" that is not an object or where class could not be found in "ComplexType" strategy.', $type)); + if (!$this->loader->supports($classname)) { + throw new \InvalidArgumentException(sprintf('Cannot add a complex type "%s" that is not an object or where class could not be found in "ComplexType" strategy.', $classname)); } - $xmlName = $this->getContext()->translateType($type); - $xmlType = 'tns:'.$xmlName; + $type = $this->getContext()->translateType($classname); + $xmlType = 'tns:'.$type; // Register type here to avoid recursion - $classmap->add($type, $xmlName); - $this->getContext()->addType($type, $soapType); + $classmap->add($type, $classname); + $this->getContext()->addType($classname, $xmlType); } - $this->addDefinition($type, $xmlName); + $this->addXmlDefinition($classname, $type); return $xmlType; } - private function addDefinition($type, $xmlName) + private function addXmlDefinition($classname, $type) { - if ($this->definition->hasDefinitionComplexType($type)) { + if ($this->definition->hasDefinitionComplexType($classname)) { return false; } $dom = $this->getContext()->toDomDocument(); $complexType = $dom->createElement('xsd:complexType'); - $complexType->setAttribute('name', $xmlName); + $complexType->setAttribute('name', $type); $all = $dom->createElement('xsd:all'); $elements = array(); - $definitionComplexType = $this->loader->load($type); + $definitionComplexType = $this->loader->load($classname); foreach ($definitionComplexType as $annotationComplexType) { $element = $dom->createElement('xsd:element'); $element->setAttribute('name', $annotationComplexType->getName()); From e765ea746e9aa7d850fbb42a0a0ceb20d68171b7 Mon Sep 17 00:00:00 2001 From: Francis Besset Date: Tue, 23 Jul 2013 14:44:32 +0200 Subject: [PATCH 5/7] [SoapBundle] Moved configuration of ComplexType aliases from config to PHP objects with annotations Before: ``` yaml be_simple_soap: services_classmap: Cutomer: My\Bundle\Entity\Customer Cart: My\Bundle\Entity\Cart After: ``` php + * (c) Francis Besset + * + * This source file is subject to the MIT license that is bundled + * with this source code in the file LICENSE. + */ + +namespace BeSimple\SoapBundle\ServiceDefinition\Annotation; + +/** + * @Annotation + */ +class Alias extends Configuration +{ + private $value; + + public function getValue() + { + return $this->value; + } + + public function setValue($value) + { + $this->value = $value; + } + + public function getAliasName() + { + return 'alias'; + } +} diff --git a/src/BeSimple/SoapBundle/ServiceDefinition/Annotation/Configuration.php b/src/BeSimple/SoapBundle/ServiceDefinition/Annotation/Configuration.php index f7c4d0a..2334809 100644 --- a/src/BeSimple/SoapBundle/ServiceDefinition/Annotation/Configuration.php +++ b/src/BeSimple/SoapBundle/ServiceDefinition/Annotation/Configuration.php @@ -21,10 +21,10 @@ abstract class Configuration implements ConfigurationInterface { foreach ($values as $k => $v) { if (!method_exists($this, $name = 'set'.$k)) { - throw new \RuntimeException(sprintf('Unknown key "%s" for annotation "@%s".', $k, get_class($this))); + throw new \RuntimeException(sprintf('Unknown key "%s" for annotation "@%s".', $k, __CLASS__)); } $this->$name($v); } } -} \ No newline at end of file +} diff --git a/src/BeSimple/SoapBundle/ServiceDefinition/Loader/AnnotationComplexTypeLoader.php b/src/BeSimple/SoapBundle/ServiceDefinition/Loader/AnnotationComplexTypeLoader.php index 0cc7579..053aa0e 100644 --- a/src/BeSimple/SoapBundle/ServiceDefinition/Loader/AnnotationComplexTypeLoader.php +++ b/src/BeSimple/SoapBundle/ServiceDefinition/Loader/AnnotationComplexTypeLoader.php @@ -22,6 +22,7 @@ use BeSimple\SoapBundle\Util\Collection; */ class AnnotationComplexTypeLoader extends AnnotationClassLoader { + private $aliasClass = 'BeSimple\SoapBundle\ServiceDefinition\Annotation\Alias'; private $complexTypeClass = 'BeSimple\SoapBundle\ServiceDefinition\Annotation\ComplexType'; /** @@ -40,9 +41,14 @@ class AnnotationComplexTypeLoader extends AnnotationClassLoader throw new \InvalidArgumentException(sprintf('Class "%s" does not exist.', $class)); } - $class = new \ReflectionClass($class); - $collection = new Collection('getName', 'BeSimple\SoapBundle\ServiceDefinition\ComplexType'); + $annotations = array(); + $class = new \ReflectionClass($class); + if ($alias = $this->reader->getClassAnnotation($class, $this->aliasClass)) { + $annotations['alias'] = $alias->getValue(); + } + + $annotations['properties'] = new Collection('getName', 'BeSimple\SoapBundle\ServiceDefinition\ComplexType'); foreach ($class->getProperties() as $property) { $complexType = $this->reader->getPropertyAnnotation($property, $this->complexTypeClass); @@ -51,10 +57,10 @@ class AnnotationComplexTypeLoader extends AnnotationClassLoader $propertyComplexType->setValue($complexType->getValue()); $propertyComplexType->setNillable($complexType->isNillable()); $propertyComplexType->setName($property->getName()); - $collection->add($propertyComplexType); + $annotations['properties']->add($propertyComplexType); } } - return $collection; + return $annotations; } -} \ No newline at end of file +} diff --git a/src/BeSimple/SoapBundle/ServiceDefinition/ServiceDefinition.php b/src/BeSimple/SoapBundle/ServiceDefinition/ServiceDefinition.php index b748c4b..cb9834e 100644 --- a/src/BeSimple/SoapBundle/ServiceDefinition/ServiceDefinition.php +++ b/src/BeSimple/SoapBundle/ServiceDefinition/ServiceDefinition.php @@ -133,13 +133,13 @@ class ServiceDefinition return isset($this->complexTypes[$type]); } - public function addDefinitionComplexType($type, Collection $complexType) + public function addDefinitionComplexType($type, $definition) { if ($this->hasDefinitionComplexType($type)) { return false; } - $this->complexTypes[$type] = $complexType; + $this->complexTypes[$type] = $definition; return true; } diff --git a/src/BeSimple/SoapBundle/ServiceDefinition/Strategy/ComplexType.php b/src/BeSimple/SoapBundle/ServiceDefinition/Strategy/ComplexType.php index 0e0b579..ab824ad 100644 --- a/src/BeSimple/SoapBundle/ServiceDefinition/Strategy/ComplexType.php +++ b/src/BeSimple/SoapBundle/ServiceDefinition/Strategy/ComplexType.php @@ -38,54 +38,43 @@ class ComplexType extends AbstractComplexTypeStrategy */ public function addComplexType($classname) { - // Really needed? - if (null !== $type = $this->scanRegisteredTypes($classname)) { - return $type; - } - $classmap = $this->definition->getClassmap(); if ($classmap->hasByClassname($classname)) { - $type = $classmap->getByClassname($classname); - - $xmlType = 'tns:'.$type; - } else { - if (!$this->loader->supports($classname)) { - throw new \InvalidArgumentException(sprintf('Cannot add a complex type "%s" that is not an object or where class could not be found in "ComplexType" strategy.', $classname)); - } - - $type = $this->getContext()->translateType($classname); - $xmlType = 'tns:'.$type; - - // Register type here to avoid recursion - $classmap->add($type, $classname); - $this->getContext()->addType($classname, $xmlType); + return 'tns:'.$classmap->getByClassname($classname); } - $this->addXmlDefinition($classname, $type); + if (!$this->loader->supports($classname)) { + throw new \InvalidArgumentException(sprintf('Cannot add ComplexType "%s" because it is not an object or the class could not be found.', $classname)); + } + + $definitionComplexType = $this->loader->load($classname); + $classnameAlias = isset($definitionComplexType['alias']) ? $definitionComplexType['alias'] : $classname; + + $type = $this->getContext()->translateType($classnameAlias); + $xmlType = 'tns:'.$type; + + // Register type here to avoid recursion + $classmap->add($type, $classname); + $this->addXmlDefinition($definitionComplexType, $classname, $type); return $xmlType; } - private function addXmlDefinition($classname, $type) + private function addXmlDefinition(array $definitionComplexType, $classname, $type) { - if ($this->definition->hasDefinitionComplexType($classname)) { - return false; - } - $dom = $this->getContext()->toDomDocument(); $complexType = $dom->createElement('xsd:complexType'); $complexType->setAttribute('name', $type); $all = $dom->createElement('xsd:all'); - $elements = array(); - $definitionComplexType = $this->loader->load($classname); - foreach ($definitionComplexType as $annotationComplexType) { + $elements = array(); + foreach ($definitionComplexType['properties'] as $property) { $element = $dom->createElement('xsd:element'); - $element->setAttribute('name', $annotationComplexType->getName()); - $element->setAttribute('type', $this->getContext()->getType($annotationComplexType->getValue())); + $element->setAttribute('name', $property->getName()); + $element->setAttribute('type', $this->getContext()->getType($property->getValue())); - if ($annotationComplexType->isNillable()) { + if ($property->isNillable()) { $element->setAttribute('nillable', 'true'); } @@ -96,7 +85,5 @@ class ComplexType extends AbstractComplexTypeStrategy $this->getContext()->getSchema()->appendChild($complexType); $this->definition->addDefinitionComplexType($type, $definitionComplexType); - - return true; } } From 5aefca6be78a872ed525f4dfb6ac852c434aca4c Mon Sep 17 00:00:00 2001 From: Francis Besset Date: Tue, 23 Jul 2013 15:05:57 +0200 Subject: [PATCH 6/7] [SoapBundle] Cleaned configuration --- .../DependencyInjection/BeSimpleSoapExtension.php | 5 ----- .../SoapBundle/DependencyInjection/Configuration.php | 9 --------- .../SoapBundle/ServiceDefinition/ServiceDefinition.php | 2 +- 3 files changed, 1 insertion(+), 15 deletions(-) diff --git a/src/BeSimple/SoapBundle/DependencyInjection/BeSimpleSoapExtension.php b/src/BeSimple/SoapBundle/DependencyInjection/BeSimpleSoapExtension.php index 45e5603..941cbf0 100644 --- a/src/BeSimple/SoapBundle/DependencyInjection/BeSimpleSoapExtension.php +++ b/src/BeSimple/SoapBundle/DependencyInjection/BeSimpleSoapExtension.php @@ -57,11 +57,6 @@ class BeSimpleSoapExtension extends Extension $container->setParameter('besimple.soap.definition.dumper.options.stylesheet', $config['wsdl_dumper']['stylesheet']); - $container - ->getDefinition('besimple.soap.server.classmap') - ->addMethodCall('set', array($config['services_classmap'])) - ; - foreach($config['services'] as $name => $serviceConfig) { $serviceConfig['name'] = $name; $this->createWebServiceContext($serviceConfig, $container); diff --git a/src/BeSimple/SoapBundle/DependencyInjection/Configuration.php b/src/BeSimple/SoapBundle/DependencyInjection/Configuration.php index 76c9809..f7fa94d 100644 --- a/src/BeSimple/SoapBundle/DependencyInjection/Configuration.php +++ b/src/BeSimple/SoapBundle/DependencyInjection/Configuration.php @@ -97,8 +97,6 @@ class Configuration { $rootNode ->children() - - // "services" section ->arrayNode('services') ->useAttributeAsKey('name') ->prototype('array') @@ -122,13 +120,6 @@ class Configuration ->end() ->end() ->end() - - // "services_classmap" section - ->arrayNode('services_classmap') - ->useAttributeAsKey('name') - ->prototype('scalar')->end() - ->end() - ->end() ->end() ; } diff --git a/src/BeSimple/SoapBundle/ServiceDefinition/ServiceDefinition.php b/src/BeSimple/SoapBundle/ServiceDefinition/ServiceDefinition.php index cb9834e..8cfe302 100644 --- a/src/BeSimple/SoapBundle/ServiceDefinition/ServiceDefinition.php +++ b/src/BeSimple/SoapBundle/ServiceDefinition/ServiceDefinition.php @@ -133,7 +133,7 @@ class ServiceDefinition return isset($this->complexTypes[$type]); } - public function addDefinitionComplexType($type, $definition) + public function addDefinitionComplexType($type, array $definition) { if ($this->hasDefinitionComplexType($type)) { return false; From 762ca4d7eb99d2a467259bcb5fc207ad87d1b4d3 Mon Sep 17 00:00:00 2001 From: Francis Besset Date: Mon, 5 Aug 2013 09:52:54 +0200 Subject: [PATCH 7/7] [SoapBundle] [Doc] Updated documentation to Alias documentation --- .../doc/soapserver/tutorial/complex_type.rst | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/BeSimple/SoapBundle/Resources/doc/soapserver/tutorial/complex_type.rst b/src/BeSimple/SoapBundle/Resources/doc/soapserver/tutorial/complex_type.rst index 034d762..0c8b84a 100644 --- a/src/BeSimple/SoapBundle/Resources/doc/soapserver/tutorial/complex_type.rst +++ b/src/BeSimple/SoapBundle/Resources/doc/soapserver/tutorial/complex_type.rst @@ -51,8 +51,16 @@ You can expose only the properties (public, protected or private) of a complex t use BeSimple\SoapBundle\ServiceDefinition\Annotation as Soap; + /** + * @Soap\Alias("User") + */ class User { + /** + * @Soap\ComplexType("int", nillable=true) + */ + private $id; + /** * @Soap\ComplexType("string") */ @@ -63,11 +71,6 @@ You can expose only the properties (public, protected or private) of a complex t */ public $lastname; - /** - * @Soap\ComplexType("int", nillable=true) - */ - private $id; - /** * @Soap\ComplexType("string") */ @@ -135,3 +138,9 @@ ComplexType `ComplexType` accepts the following options: * nillable: To specify that the value can be null + +Alias +----- + +If you can Alias annotation, the name of your entity will be renamed in the WSDL generated. +With alias the name in WSDL will `User` instead of `Acme.DemoBundle.Entity.User` (name without Alias annotation).