Used BeSimple\SoapCommon\Classmap for the webservice context

This commit is contained in:
Francis Besset
2011-10-12 21:08:59 +02:00
parent 4a7ec164e5
commit 70a85460c9
7 changed files with 38 additions and 25 deletions

View File

@ -12,6 +12,7 @@ namespace BeSimple\SoapBundle\ServiceDefinition\Strategy;
use BeSimple\SoapBundle\ServiceDefinition\Loader\AnnotationComplexTypeLoader;
use BeSimple\SoapCommon\Classmap;
use Zend\Soap\Wsdl;
use Zend\Soap\Wsdl\Strategy\AbstractStrategy;
@ -21,11 +22,13 @@ use Zend\Soap\Wsdl\Strategy\AbstractStrategy;
class ComplexType extends AbstractStrategy
{
private $loader;
private $classmap;
private $definition;
public function __construct(AnnotationComplexTypeLoader $loader, $definition)
public function __construct(AnnotationComplexTypeLoader $loader, Classmap $classmap, $definition)
{
$this->loader = $loader;
$this->classmap = $classmap;
$this->definition = $definition;
}
@ -50,6 +53,8 @@ class ComplexType extends AbstractStrategy
$soapTypeName = Wsdl::translateType($type);
$soapType = 'tns:'.$soapTypeName;
$this->classmap->add($soapTypeName, $type);
// Register type here to avoid recursion
$this->getContext()->addType($type, $soapType);