summaryrefslogtreecommitdiff
path: root/framework/Web/Services/TSoapService.php
diff options
context:
space:
mode:
authorcarlgmathisen <>2008-12-07 13:05:05 +0000
committercarlgmathisen <>2008-12-07 13:05:05 +0000
commit736e92efbc75908a2bf26fe333a03990e3bb8100 (patch)
tree21dfe413b2f3f52704ca28e17f22269f9cfdb5ea /framework/Web/Services/TSoapService.php
parent6228873cf9d6471463d2413e7dfd7447f759baf2 (diff)
work on php style configuration
Diffstat (limited to 'framework/Web/Services/TSoapService.php')
-rw-r--r--framework/Web/Services/TSoapService.php25
1 files changed, 17 insertions, 8 deletions
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 @@
* </service>
* </services>
* </code>
- *
- * 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:
* <code>
- * http://hostname/path/to/index.php?soap=stockquote.wsdl
+ * 'services' => array(
+ * 'soap' => array(
+ * 'class' => 'System.Web.Services.TSoapService'
+ * 'properties' => array(
+ * 'provider' => 'MyStockQuote'
+ * )
+ * )
+ * )
* </code>
*
* The WSDL for the provider class "MyStockQuote" is generated based on special
@@ -79,13 +83,13 @@
*
* @author Knut Urdalen <knut.urdalen@gmail.com>
* @author Qiang Xue <qiang.xue@gmail.com>
+ * @author Carl G. Mathisen <carlgmathisen@gmail.com>
* @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;