From 1a5ff45a39454bdc7df13b265ab48dfac142c461 Mon Sep 17 00:00:00 2001 From: Christian Kerl Date: Mon, 4 Oct 2010 21:13:45 +0200 Subject: [PATCH] added DependencyInjection configuration for SoapKernel --- DependencyInjection/WebServiceExtension.php | 7 ++++++- Resources/config/services.xml | 15 +++++++++++++++ SoapKernel.php | 17 +++++++++++++++-- 3 files changed, 36 insertions(+), 3 deletions(-) diff --git a/DependencyInjection/WebServiceExtension.php b/DependencyInjection/WebServiceExtension.php index ae21f02..96043fb 100644 --- a/DependencyInjection/WebServiceExtension.php +++ b/DependencyInjection/WebServiceExtension.php @@ -2,6 +2,8 @@ namespace Bundle\WebServiceBundle\DependencyInjection; +use Symfony\Component\DependencyInjection\Loader\XmlFileLoader; + use Symfony\Component\DependencyInjection\Extension\Extension; use Symfony\Component\DependencyInjection\ContainerBuilder; @@ -9,7 +11,10 @@ class WebServiceExtension extends Extension { public function configLoad(array $config, ContainerBuilder $configuration) { - $configuration->getDefinition("request")->setClass("Bundle\\WebServiceBundle\\SoapRequest"); + $loader = new XmlFileLoader($configuration, __DIR__ . "/../Resources/config"); + $loader->load("services.xml"); + + $configuration->setAlias("http_kernel", "webservice_http_kernel"); } public function getXsdValidationBasePath() diff --git a/Resources/config/services.xml b/Resources/config/services.xml index 44a1a1f..be00ff3 100644 --- a/Resources/config/services.xml +++ b/Resources/config/services.xml @@ -3,4 +3,19 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.symfony-project.org/schema/dic/services http://www.symfony-project.org/schema/dic/services/services-1.0.xsd"> + + Bundle\WebServiceBundle\SoapRequest + + + + + + + + + + + + + \ No newline at end of file diff --git a/SoapKernel.php b/SoapKernel.php index 8af1562..28644c5 100644 --- a/SoapKernel.php +++ b/SoapKernel.php @@ -2,9 +2,22 @@ namespace Bundle\WebServiceBundle; -use Symfony\Component\HttpKernel\HttpKernel; +use Symfony\Component\HttpFoundation\Request; -class SoapKernel extends HttpKernel +use Symfony\Component\DependencyInjection\ContainerAware; + +use Symfony\Component\HttpKernel\HttpKernelInterface; + + +class SoapKernel extends ContainerAware implements HttpKernelInterface { + public function getRequest() + { + return null; + } + public function handle(Request:: $request = null, $type = self::MASTER_REQUEST, $raw = false) + { + $this->container->getSymfonyHttpKernelService()->handle($request, $type, $raw); + } } \ No newline at end of file