some small fixes to get it working

This commit is contained in:
Christian Kerl 2011-04-09 00:43:47 +02:00
parent 8367556323
commit ce844e799f
2 changed files with 9 additions and 6 deletions

View File

@ -109,13 +109,13 @@ class SoapWebServiceController extends ContainerAware
$endpoint = $this->container->get('router')->generate('_webservice_call', array('webservice' => $webservice), true); $endpoint = $this->container->get('router')->generate('_webservice_call', array('webservice' => $webservice), true);
$response = new Response($webServiceContext->getWsdlFileContent($endpoint)); $response = new Response($webServiceContext->getWsdlFileContent($endpoint));
$response->headers->set('Content-Type', 'text/plain'); $response->headers->set('Content-Type', 'application/wsdl+xml');
} }
else else
{ {
$response = new Response('woho'); // TODO: replace with better represantation
// dump pretty definition $response = new Response($webServiceContext->getWsdlFileContent());
// return $this->container->get('templating')->renderView(''); $response->headers->set('Content-Type', 'text/xml');
} }
return $response; return $response;
@ -149,7 +149,7 @@ class SoapWebServiceController extends ContainerAware
); );
// forward to controller // 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); $this->soapResponse = $this->checkResponse($response);
@ -178,7 +178,7 @@ class SoapWebServiceController extends ContainerAware
*/ */
protected function checkResponse(Response $response) protected function checkResponse(Response $response)
{ {
if($response == null || $response instanceof SoapResponse) if($response == null || !$response instanceof SoapResponse)
{ {
throw new \InvalidArgumentException(); throw new \InvalidArgumentException();
} }

View File

@ -96,6 +96,9 @@ class SoapServerFactory
private function addSoapServerClassmapEntry(&$classmap, Type $type) private function addSoapServerClassmapEntry(&$classmap, Type $type)
{ {
// TODO: fix this hack
if($type->getXmlType() === null) return;
$xmlType = QName::fromPackedQName($type->getXmlType())->getName(); $xmlType = QName::fromPackedQName($type->getXmlType())->getName();
$phpType = $type->getPhpType(); $phpType = $type->getPhpType();