From d3a8965500d3ccf9ec8c6e6671ab238e871d6b8b Mon Sep 17 00:00:00 2001 From: Francis Besset Date: Sun, 14 Aug 2011 18:13:12 +0200 Subject: [PATCH 1/2] [Doc] Updated array tutorial --- Resources/doc/tutorial/array.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Resources/doc/tutorial/array.rst b/Resources/doc/tutorial/array.rst index 32b28ff..7972624 100644 --- a/Resources/doc/tutorial/array.rst +++ b/Resources/doc/tutorial/array.rst @@ -15,12 +15,12 @@ Controller class DemoController extends ContainerAware { /** - * @Soap\Method("isString") - * @Soap\Param("strings", phpType = "string[]") - * @Soap\Result(phpType = "boolean") + * @Soap\Method("hello") + * @Soap\Param("names", phpType = "string[]") + * @Soap\Result(phpType = "string") */ - public function helloAction(array $strings) + public function helloAction(array $names) { - return new SoapResponse(true); + return new SoapResponse("Hello ".implode(', ', $names)); } } \ No newline at end of file From 33165ce8d21990925fef8cf301ba695af8cc554e Mon Sep 17 00:00:00 2001 From: Francis Besset Date: Sun, 14 Aug 2011 21:06:04 +0200 Subject: [PATCH 2/2] 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;