summaryrefslogtreecommitdiff
path: root/framework/Web/Services/TSoapService.php
diff options
context:
space:
mode:
authorcarlgmathisen <>2008-12-02 00:02:51 +0000
committercarlgmathisen <>2008-12-02 00:02:51 +0000
commit439b0b12dc8f6cbeb769fe4f2c0061ff9d3c9d31 (patch)
tree30046fc52a8c2ae53bad05224c95dbabd0d5238f /framework/Web/Services/TSoapService.php
parentc356dfc6660d68f1e7fbde92aaf15c6a94894d4f (diff)
php configuration type
Diffstat (limited to 'framework/Web/Services/TSoapService.php')
-rw-r--r--framework/Web/Services/TSoapService.php38
1 files changed, 27 insertions, 11 deletions
diff --git a/framework/Web/Services/TSoapService.php b/framework/Web/Services/TSoapService.php
index 24f95a35..259fa5f8 100644
--- a/framework/Web/Services/TSoapService.php
+++ b/framework/Web/Services/TSoapService.php
@@ -148,19 +148,35 @@ class TSoapService extends TService
/**
* Loads configuration from an XML element
- * @param TXmlElement configuration node
+ * @param mixed configuration node
* @throws TConfigurationException if soap server id is not specified or duplicated
*/
- private function loadConfig($xml)
- {
- foreach($xml->getElementsByTagName('soap') as $serverXML)
+ private function loadConfig($config)
+ {
+ if($this->getApplication()->getConfigurationType()==TApplication::CONFIG_TYPE_PHP)
+ {
+ if(is_array($config))
+ {
+ foreach($config as $id => $server)
+ {
+ $properties = isset($server['properties'])?$server['properties']:array();
+ if(isset($this->_servers[$id]))
+ throw new TConfigurationException('soapservice_serverid_duplicated',$id);
+ $this->_servers[$id]=$properties;
+ }
+ }
+ }
+ else
{
- $properties=$serverXML->getAttributes();
- if(($id=$properties->remove('id'))===null)
- throw new TConfigurationException('soapservice_serverid_required');
- if(isset($this->_servers[$id]))
- throw new TConfigurationException('soapservice_serverid_duplicated',$id);
- $this->_servers[$id]=$properties;
+ foreach($config->getElementsByTagName('soap') as $serverXML)
+ {
+ $properties=$serverXML->getAttributes();
+ if(($id=$properties->remove('id'))===null)
+ throw new TConfigurationException('soapservice_serverid_required');
+ if(isset($this->_servers[$id]))
+ throw new TConfigurationException('soapservice_serverid_duplicated',$id);
+ $this->_servers[$id]=$properties;
+ }
}
}
@@ -221,7 +237,7 @@ class TSoapService extends TService
protected function createServer()
{
$properties=$this->_servers[$this->_serverID];
- if(($serverClass=$properties->remove('class'))===null)
+ if($this->getApplication()->getConfigurationType()==TApplication::CONFIG_TYPE_PHP || ($serverClass=$properties->remove('class'))===null)
$serverClass=self::DEFAULT_SOAP_SERVER;
Prado::using($serverClass);
$className=($pos=strrpos($serverClass,'.'))!==false?substr($serverClass,$pos+1):$serverClass;