summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwei <>2007-03-31 07:01:18 +0000
committerwei <>2007-03-31 07:01:18 +0000
commitc619ade9b79afdbc176bba6180a37970cd4343e2 (patch)
treed5d35ac79b87674c451e55150362659fa6c93654
parent54c90d0102515ad58a882a6b3f4ac623fc9d50ed (diff)
added primitive array soap types.
http://www.pradosoft.com/forum/index.php/topic,7095.0/topicseen.html
-rw-r--r--framework/3rdParty/WsdlGen/Wsdl.php13
1 files changed, 12 insertions, 1 deletions
diff --git a/framework/3rdParty/WsdlGen/Wsdl.php b/framework/3rdParty/WsdlGen/Wsdl.php
index eaf95ef1..4de57e6b 100644
--- a/framework/3rdParty/WsdlGen/Wsdl.php
+++ b/framework/3rdParty/WsdlGen/Wsdl.php
@@ -78,6 +78,8 @@ class Wsdl
private $_encoding='';
+ private static $_primitiveTypes = array('string', 'int', 'float', 'boolean');
+
/**
* Creates a new Wsdl thing
* @param string $name the name of the service.
@@ -151,7 +153,7 @@ class Wsdl
$restriction->setAttribute('base', 'soap-enc:Array');
$attribute = $dom->createElementNS('http://www.w3.org/2001/XMLSchema', 'xsd:attribute');
$attribute->setAttribute('ref', "soap-enc:arrayType");
- $attribute->setAttribute('wsdl:arrayType', 'tns:' . substr($type, 0, strlen($type) - 5) . '[]');
+ $attribute->setAttribute('wsdl:arrayType', $this->getArrayTypePrefix($type) . substr($type, 0, strlen($type) - 5) . '[]');
$restriction->appendChild($attribute);
$complexContent->appendChild($restriction);
$complexType->appendChild($complexContent);
@@ -176,6 +178,15 @@ class Wsdl
}
/**
+ * @return string prefix 'xsd:' for primitive array types, otherwise, 'tns:'
+ */
+ protected function getArrayTypePrefix($type)
+ {
+ $elementType = substr($type, 0, strlen($type) - 5);
+ return in_array($elementType, self::$_primitiveTypes) ? 'xsd:' : 'tns:';
+ }
+
+ /**
* Add messages for the service
* @param DomDocument $dom The document to add to
*/