Used TypeConverterCollection::getTypemap() to build the typemap for SoapServer

This commit is contained in:
Francis Besset 2011-09-13 21:08:33 +02:00
parent 95c08c6edf
commit 3de0636bb8
1 changed files with 1 additions and 21 deletions

View File

@ -67,33 +67,13 @@ class SoapServerFactory
$this->wsdlFile,
array(
'classmap' => $this->classmap,
'typemap' => $this->createSoapServerTypemap($request, $response),
'typemap' => $this->converters->getTypemap(),
'features' => SOAP_SINGLE_ELEMENT_ARRAYS,
'cache_wsdl' => null !== $this->options['cache_type'] ? $this->options['cache_type'] : Cache::getType(),
)
);
}
private function createSoapServerTypemap($request, $response)
{
$typemap = array();
foreach($this->converters->all() as $typeConverter) {
$typemap[] = array(
'type_name' => $typeConverter->getTypeName(),
'type_ns' => $typeConverter->getTypeNamespace(),
'from_xml' => function($input) use ($typeConverter) {
return $typeConverter->convertXmlToPhp($input);
},
'to_xml' => function($input) use ($typeConverter) {
return $typeConverter->convertPhpToXml($input);
},
);
}
return $typemap;
}
private function fixSoapServerClassmap($classmap)
{
$classmapFixed = array();