From 33165ce8d21990925fef8cf301ba695af8cc554e Mon Sep 17 00:00:00 2001 From: Francis Besset Date: Sun, 14 Aug 2011 21:06:04 +0200 Subject: [PATCH] Refactored the declaration of services for ServiceBinder --- DependencyInjection/BeSimpleSoapExtension.php | 4 ++-- Resources/config/webservice.xml | 16 ++++------------ WebServiceContext.php | 13 ++++++------- 3 files changed, 12 insertions(+), 21 deletions(-) diff --git a/DependencyInjection/BeSimpleSoapExtension.php b/DependencyInjection/BeSimpleSoapExtension.php index e6a271f..faeb6bf 100644 --- a/DependencyInjection/BeSimpleSoapExtension.php +++ b/DependencyInjection/BeSimpleSoapExtension.php @@ -60,8 +60,8 @@ class BeSimpleSoapExtension extends Extension $options = $container ->getDefinition('besimple.soap.context.'.$bindingSuffix) - ->getArgument(6); + ->getArgument(4); - $definition->replaceArgument(6, array_merge($options, $config)); + $definition->replaceArgument(4, array_merge($options, $config)); } } diff --git a/Resources/config/webservice.xml b/Resources/config/webservice.xml index 3dfa981..5b7798f 100644 --- a/Resources/config/webservice.xml +++ b/Resources/config/webservice.xml @@ -19,37 +19,29 @@ - - %besimple.soap.cache_dir% %kernel.debug% + %besimple.soap.binder.request.rpcliteral.class% + %besimple.soap.binder.response.rpcliteral.class% - - %besimple.soap.cache_dir% %kernel.debug% + %besimple.soap.binder.request.documentwrapped.class% + %besimple.soap.binder.response.documentwrapped.class% - - - - - - - - diff --git a/WebServiceContext.php b/WebServiceContext.php index f0acaf6..7303809 100644 --- a/WebServiceContext.php +++ b/WebServiceContext.php @@ -27,8 +27,6 @@ use Symfony\Component\Config\Loader\LoaderInterface; */ class WebServiceContext { - private $requestMessageBinder; - private $responseMessageBinder; private $typeRepository; private $converterRepository; @@ -40,13 +38,10 @@ class WebServiceContext private $serviceBinder; private $serverFactory; - public function __construct(LoaderInterface $loader, DumperInterface $dumper, MessageBinderInterface $requestMessageBinder, MessageBinderInterface $responseMessageBinder, TypeRepository $typeRepository, ConverterRepository $converterRepository, array $options) { + public function __construct(LoaderInterface $loader, DumperInterface $dumper, TypeRepository $typeRepository, ConverterRepository $converterRepository, array $options) { $this->loader = $loader; $this->wsdlFileDumper = $dumper; - $this->requestMessageBinder = $requestMessageBinder; - $this->responseMessageBinder = $responseMessageBinder; - $this->typeRepository = $typeRepository; $this->converterRepository = $converterRepository; @@ -90,7 +85,11 @@ class WebServiceContext public function getServiceBinder() { if (null === $this->serviceBinder) { - $this->serviceBinder = new ServiceBinder($this->getServiceDefinition(), $this->requestMessageBinder, $this->responseMessageBinder); + $this->serviceBinder = new ServiceBinder( + $this->getServiceDefinition(), + new $this->options['binder_request_class'](), + new $this->options['binder_response_class']() + ); } return $this->serviceBinder;