|
|
@@ -19,9 +19,9 @@
|
|
|
* @version $Id$
|
|
|
*/
|
|
|
|
|
|
-require_once "Zend/Soap/Wsdl/Strategy/Abstract.php";
|
|
|
+require_once "Zend/Soap/Wsdl/Strategy/DefaultComplexType.php";
|
|
|
|
|
|
-class Zend_Soap_Wsdl_Strategy_ArrayOfTypeSequence extends Zend_Soap_Wsdl_Strategy_Abstract
|
|
|
+class Zend_Soap_Wsdl_Strategy_ArrayOfTypeSequence extends Zend_Soap_Wsdl_Strategy_DefaultComplexType
|
|
|
{
|
|
|
/**
|
|
|
* Add an unbounded ArrayOfType based on the xsd:sequence syntax if type[] is detected in return value doc comment.
|
|
|
@@ -37,7 +37,7 @@ class Zend_Soap_Wsdl_Strategy_ArrayOfTypeSequence extends Zend_Soap_Wsdl_Strateg
|
|
|
$singularType = $this->_getSingularType($type);
|
|
|
|
|
|
for($i = 1; $i <= $nestedCounter; $i++) {
|
|
|
- $complexTypeName = $this->_getTypeNameBasedOnNestingLevel($singularType, $i);
|
|
|
+ $complexTypeName = substr($this->_getTypeNameBasedOnNestingLevel($singularType, $i), 4);
|
|
|
$childTypeName = $this->_getTypeNameBasedOnNestingLevel($singularType, $i-1);
|
|
|
|
|
|
$this->_addElementFromWsdlAndChildTypes($complexTypeName, $childTypeName);
|
|
|
@@ -46,11 +46,12 @@ class Zend_Soap_Wsdl_Strategy_ArrayOfTypeSequence extends Zend_Soap_Wsdl_Strateg
|
|
|
$this->getContext()->addType($complexTypeName);
|
|
|
|
|
|
return "tns:$complexTypeName";
|
|
|
+ } else if (!in_array($type, $this->getContext()->getTypes())) {
|
|
|
+ // New singular complex type
|
|
|
+ return parent::addComplexType($type);
|
|
|
} else {
|
|
|
- require_once "Zend/Soap/Wsdl/Exception.php";
|
|
|
- throw new Zend_Soap_Wsdl_Exception(sprintf(
|
|
|
- 'ArrayOfTypeSequence Strategy does not allow for complex types that are not in @return type[] syntax. "%s" type was specified.', $type
|
|
|
- ));
|
|
|
+ // Existing complex type
|
|
|
+ return $this->getContext()->getType($type);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -70,7 +71,7 @@ class Zend_Soap_Wsdl_Strategy_ArrayOfTypeSequence extends Zend_Soap_Wsdl_Strateg
|
|
|
$prefix = str_repeat("ArrayOf", $level);
|
|
|
$xsdType = $this->_getStrippedXsdType($singularType);
|
|
|
$arrayType = $prefix.$xsdType;
|
|
|
- return $arrayType;
|
|
|
+ return "tns:$arrayType";
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -95,14 +96,6 @@ class Zend_Soap_Wsdl_Strategy_ArrayOfTypeSequence extends Zend_Soap_Wsdl_Strateg
|
|
|
protected function _getSingularType($type)
|
|
|
{
|
|
|
$singulartype = $this->getContext()->getType(str_replace("[]", "", $type));
|
|
|
-
|
|
|
- if(substr($singulartype, 0, 4) != "xsd:") {
|
|
|
- require_once "Zend/Soap/Wsdl/Exception.php";
|
|
|
- throw new Zend_Soap_Wsdl_Exception(sprintf(
|
|
|
- 'ArrayOfTypeSequence Strategy works only with arrays of simple types like int, string, boolean, not with "%s".'.
|
|
|
- 'You may use Zend_Soap_Wsdl_Strategy_ArrayOfTypeComplex for more complex types.', $type
|
|
|
- ));
|
|
|
- }
|
|
|
return $singulartype;
|
|
|
}
|
|
|
|
|
|
@@ -147,4 +140,4 @@ class Zend_Soap_Wsdl_Strategy_ArrayOfTypeSequence extends Zend_Soap_Wsdl_Strateg
|
|
|
$this->getContext()->addType($arrayType);
|
|
|
}
|
|
|
}
|
|
|
-}
|
|
|
+}
|