added support for 'typemap' and 'classmap' SoapServer option

This commit is contained in:
Christian Kerl
2010-12-30 02:18:10 +01:00
parent 4cc5950a66
commit 60795fbcbb
8 changed files with 229 additions and 9 deletions

View File

@ -10,6 +10,7 @@
namespace Bundle\WebServiceBundle;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
@ -21,6 +22,8 @@ use Bundle\WebServiceBundle\Soap\SoapHeader;
use Bundle\WebServiceBundle\ServiceBinding\ServiceBinder;
use Bundle\WebServiceBundle\Converter\ConverterRepository;
use Bundle\WebServiceBundle\Util\String;
/**
@ -58,11 +61,18 @@ class SoapKernel implements HttpKernelInterface
*/
protected $kernel;
public function __construct(ServiceBinder $serviceBinder, HttpKernelInterface $kernel)
public function __construct(ServiceBinder $serviceBinder, ConverterRepository $converterRepository, HttpKernelInterface $kernel)
{
$this->serviceBinder = $serviceBinder;
$this->soapServer = new \SoapServer($this->serviceBinder->getSerializedServiceDefinition());
$this->soapServer = new \SoapServer(
$this->serviceBinder->getSerializedServiceDefinition(),
array(
'classmap' => $this->serviceBinder->getSoapServerClassmap(),
'typemap' => $converterRepository->toSoapServerTypemap($this),
'features' => SOAP_SINGLE_ELEMENT_ARRAYS,
)
);
$this->soapServer->setObject($this);
$this->kernel = $kernel;
@ -73,7 +83,12 @@ class SoapKernel implements HttpKernelInterface
return $this->soapRequest;
}
public function handle(Request $request = null, $type = self::MASTER_REQUEST, $raw = false)
public function getResponse()
{
return $this->soapResponse;
}
public function handle(Request $request = null, $type = self::MASTER_REQUEST, $catch = true)
{
$this->soapRequest = $this->checkRequest($request);