summaryrefslogtreecommitdiff
path: root/framework/3rdParty
diff options
context:
space:
mode:
Diffstat (limited to 'framework/3rdParty')
-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
*/