From ce844e799f80d85be63172c61f4f481843b81b95 Mon Sep 17 00:00:00 2001 From: Christian Kerl Date: Sat, 9 Apr 2011 00:43:47 +0200 Subject: [PATCH] some small fixes to get it working --- Controller/SoapWebServiceController.php | 12 ++++++------ Soap/SoapServerFactory.php | 3 +++ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/Controller/SoapWebServiceController.php b/Controller/SoapWebServiceController.php index d2213a0..163590b 100644 --- a/Controller/SoapWebServiceController.php +++ b/Controller/SoapWebServiceController.php @@ -109,13 +109,13 @@ class SoapWebServiceController extends ContainerAware $endpoint = $this->container->get('router')->generate('_webservice_call', array('webservice' => $webservice), true); $response = new Response($webServiceContext->getWsdlFileContent($endpoint)); - $response->headers->set('Content-Type', 'text/plain'); + $response->headers->set('Content-Type', 'application/wsdl+xml'); } else { - $response = new Response('woho'); - // dump pretty definition - // return $this->container->get('templating')->renderView(''); + // TODO: replace with better represantation + $response = new Response($webServiceContext->getWsdlFileContent()); + $response->headers->set('Content-Type', 'text/xml'); } return $response; @@ -149,7 +149,7 @@ class SoapWebServiceController extends ContainerAware ); // forward to controller - $response = $this->kernel->handle($this->soapRequest, self::SUB_REQUEST, false); + $response = $this->kernel->handle($this->soapRequest, HttpKernelInterface::SUB_REQUEST, false); $this->soapResponse = $this->checkResponse($response); @@ -178,7 +178,7 @@ class SoapWebServiceController extends ContainerAware */ protected function checkResponse(Response $response) { - if($response == null || $response instanceof SoapResponse) + if($response == null || !$response instanceof SoapResponse) { throw new \InvalidArgumentException(); } diff --git a/Soap/SoapServerFactory.php b/Soap/SoapServerFactory.php index 27cc588..302ab19 100644 --- a/Soap/SoapServerFactory.php +++ b/Soap/SoapServerFactory.php @@ -96,6 +96,9 @@ class SoapServerFactory private function addSoapServerClassmapEntry(&$classmap, Type $type) { + // TODO: fix this hack + if($type->getXmlType() === null) return; + $xmlType = QName::fromPackedQName($type->getXmlType())->getName(); $phpType = $type->getPhpType();