added TypeRepository managing all mappings from php to xml types; removed classmap generation from SoapServerFactory, this will be done by TypeRepository::createComplexTypeMap(...);
Conflicts: Resources/config/webservice.xml Soap/SoapServerFactory.php Util/QName.php WebServiceContext.php
This commit is contained in:
committed by
Francis Besset
parent
5da442b716
commit
76e7f42ccb
@ -11,6 +11,7 @@
|
||||
namespace Bundle\WebServiceBundle;
|
||||
|
||||
use Bundle\WebServiceBundle\Converter\ConverterRepository;
|
||||
use Bundle\WebServiceBundle\Converter\TypeRepository;
|
||||
use Bundle\WebServiceBundle\ServiceBinding\MessageBinderInterface;
|
||||
use Bundle\WebServiceBundle\ServiceBinding\ServiceBinder;
|
||||
use Bundle\WebServiceBundle\ServiceDefinition\Dumper\DumperInterface;
|
||||
@ -26,9 +27,10 @@ use Symfony\Component\Config\Loader\LoaderInterface;
|
||||
*/
|
||||
class WebServiceContext
|
||||
{
|
||||
private $converterRepository;
|
||||
private $requestMessageBinder;
|
||||
private $responseMessageBinder;
|
||||
private $typeRepository;
|
||||
private $converterRepository;
|
||||
|
||||
private $wsdlFileDumper;
|
||||
|
||||
@ -38,15 +40,16 @@ class WebServiceContext
|
||||
private $serviceBinder;
|
||||
private $serverFactory;
|
||||
|
||||
public function __construct(LoaderInterface $loader, DumperInterface $dumper, ConverterRepository $converterRepository, MessageBinderInterface $requestMessageBinder, MessageBinderInterface $responseMessageBinder, array $options = array())
|
||||
{
|
||||
public function __construct(LoaderInterface $loader, DumperInterface $dumper, MessageBinderInterface $requestMessageBinder, MessageBinderInterface $responseMessageBinder, TypeRepository $typeRepository, ConverterRepository $converterRepository, array $options) {
|
||||
$this->loader = $loader;
|
||||
$this->wsdlFileDumper = $dumper;
|
||||
|
||||
$this->converterRepository = $converterRepository;
|
||||
$this->requestMessageBinder = $requestMessageBinder;
|
||||
$this->responseMessageBinder = $responseMessageBinder;
|
||||
|
||||
$this->typeRepository = $typeRepository;
|
||||
$this->converterRepository = $converterRepository;
|
||||
|
||||
$this->options = $options;
|
||||
}
|
||||
|
||||
@ -60,6 +63,8 @@ class WebServiceContext
|
||||
$this->serviceDefinition = $this->loader->load($this->options['resource'], $this->options['resource_type']);
|
||||
$this->serviceDefinition->setName($this->options['name']);
|
||||
$this->serviceDefinition->setNamespace($this->options['namespace']);
|
||||
|
||||
$this->typeRepository->fixTypeInformation($this->serviceDefinition);
|
||||
}
|
||||
|
||||
return $this->serviceDefinition;
|
||||
@ -67,15 +72,14 @@ class WebServiceContext
|
||||
|
||||
public function getWsdlFile($endpoint = null)
|
||||
{
|
||||
$id = null !== $endpoint ? '.'. md5($endpoint) : '';
|
||||
$file = sprintf('%s/%s.wsdl', $this->options['cache_dir'], $this->options['name'].$id);
|
||||
$cache = new ConfigCache($file, true);
|
||||
$file = sprintf('%s/%s.%s.wsdl', $this->options['cache_dir'], $this->options['name'], md5($endpoint));
|
||||
$cache = new ConfigCache($file, $this->options['debug']);
|
||||
|
||||
if(!$cache->isFresh()) {
|
||||
$cache->write($this->wsdlFileDumper->dumpServiceDefinition($this->getServiceDefinition(), array('endpoint' => $endpoint)));
|
||||
}
|
||||
|
||||
return $file;
|
||||
return (string) $cache;
|
||||
}
|
||||
|
||||
public function getWsdlFileContent($endpoint = null)
|
||||
@ -95,7 +99,7 @@ class WebServiceContext
|
||||
public function getServerFactory()
|
||||
{
|
||||
if (null === $this->serverFactory) {
|
||||
$this->serverFactory = new SoapServerFactory($this->getServiceDefinition(), $this->getWsdlFile(), $this->converterRepository, $this->options['debug']);
|
||||
$this->serverFactory = new SoapServerFactory($this->getWsdlFile(), array(), $this->converterRepository, $this->options['debug']);
|
||||
}
|
||||
|
||||
return $this->serverFactory;
|
||||
|
Reference in New Issue
Block a user