From 736e92efbc75908a2bf26fe333a03990e3bb8100 Mon Sep 17 00:00:00 2001 From: carlgmathisen <> Date: Sun, 7 Dec 2008 13:05:05 +0000 Subject: work on php style configuration --- framework/Web/Services/TSoapService.php | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) (limited to 'framework/Web/Services/TSoapService.php') diff --git a/framework/Web/Services/TSoapService.php b/framework/Web/Services/TSoapService.php index f5962647..d528fe1d 100644 --- a/framework/Web/Services/TSoapService.php +++ b/framework/Web/Services/TSoapService.php @@ -30,12 +30,16 @@ * * * - * - * The above example specifies a single SOAP provider named "stockquote" - * whose class is "MyStockQuote". A SOAP client can then obtain the WSDL for - * this provider via the following URL: + * PHP configuration style: * - * http://hostname/path/to/index.php?soap=stockquote.wsdl + * 'services' => array( + * 'soap' => array( + * 'class' => 'System.Web.Services.TSoapService' + * 'properties' => array( + * 'provider' => 'MyStockQuote' + * ) + * ) + * ) * * * The WSDL for the provider class "MyStockQuote" is generated based on special @@ -79,13 +83,13 @@ * * @author Knut Urdalen * @author Qiang Xue + * @author Carl G. Mathisen * @package System.Web.Services * @since 3.1 */ class TSoapService extends TService { const DEFAULT_SOAP_SERVER='TSoapServer'; - const CONFIG_FILE_EXT='.xml'; private $_servers=array(); private $_configFile=null; private $_wsdlRequest=false; @@ -195,7 +199,7 @@ class TSoapService extends TService */ public function setConfigFile($value) { - if(($this->_configFile=Prado::getPathOfNamespace($value,self::CONFIG_FILE_EXT))===null) + if(($this->_configFile=Prado::getPathOfNamespace($value,Prado::getApplication()->getConfigurationFileExt()))===null) throw new TConfigurationException('soapservice_configfile_invalid',$value); } @@ -237,7 +241,12 @@ class TSoapService extends TService protected function createServer() { $properties=$this->_servers[$this->_serverID]; - if($this->getApplication()->getConfigurationType()==TApplication::CONFIG_TYPE_PHP || ($serverClass=$properties->remove('class'))===null) + $serverClass=null; + if($this->getApplication()->getConfigurationType()==TApplication::CONFIG_TYPE_PHP && isset($config['class'])) + $serverClass=$config['class']; + else if($this->getApplication()->getConfigurationType()==TApplication::CONFIG_TYPE_XML) + $serverClass=$properties->remove('class'); + if($serverClass===null) $serverClass=self::DEFAULT_SOAP_SERVER; Prado::using($serverClass); $className=($pos=strrpos($serverClass,'.'))!==false?substr($serverClass,$pos+1):$serverClass; -- cgit v1.2.3