import v1.1.0_RC2 | 2009-09-20
This commit is contained in:
@ -15,12 +15,12 @@
|
||||
* @category Zend
|
||||
* @package Zend_Soap
|
||||
* @subpackage Wsdl
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @version $Id: Abstract.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
require_once "Interface.php";
|
||||
require_once "Zend/Soap/Wsdl/Strategy/Interface.php";
|
||||
|
||||
/**
|
||||
* Abstract class for Zend_Soap_Wsdl_Strategy.
|
||||
@ -28,7 +28,7 @@ require_once "Interface.php";
|
||||
* @category Zend
|
||||
* @package Zend_Soap
|
||||
* @subpackage Wsdl
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
abstract class Zend_Soap_Wsdl_Strategy_Abstract implements Zend_Soap_Wsdl_Strategy_Interface
|
||||
|
@ -15,12 +15,12 @@
|
||||
* @category Zend
|
||||
* @package Zend_Soap
|
||||
* @subpackage Wsdl
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @version $Id: AnyType.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
require_once "Interface.php";
|
||||
require_once "Zend/Soap/Wsdl/Strategy/Interface.php";
|
||||
|
||||
class Zend_Soap_Wsdl_Strategy_AnyType implements Zend_Soap_Wsdl_Strategy_Interface
|
||||
{
|
||||
|
@ -15,9 +15,9 @@
|
||||
* @category Zend
|
||||
* @package Zend_Soap
|
||||
* @subpackage Wsdl
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @version $Id: ArrayOfTypeComplex.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
require_once "Zend/Soap/Wsdl/Strategy/DefaultComplexType.php";
|
||||
|
@ -14,14 +14,14 @@
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Soap
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @version $Id: ArrayOfTypeSequence.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
require_once "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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -15,11 +15,13 @@
|
||||
* @category Zend
|
||||
* @package Zend_Soap
|
||||
* @subpackage Wsdl
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @version $Id: Composite.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
require_once "Zend/Soap/Wsdl/Strategy/Interface.php";
|
||||
|
||||
class Zend_Soap_Wsdl_Strategy_Composite implements Zend_Soap_Wsdl_Strategy_Interface
|
||||
{
|
||||
/**
|
||||
|
@ -15,12 +15,12 @@
|
||||
* @category Zend
|
||||
* @package Zend_Soap
|
||||
* @subpackage Wsdl
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @version $Id: DefaultComplexType.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
require_once "Abstract.php";
|
||||
require_once "Zend/Soap/Wsdl/Strategy/Abstract.php";
|
||||
|
||||
class Zend_Soap_Wsdl_Strategy_DefaultComplexType extends Zend_Soap_Wsdl_Strategy_Abstract
|
||||
{
|
||||
|
@ -15,9 +15,9 @@
|
||||
* @category Zend
|
||||
* @package Zend_Soap
|
||||
* @subpackage Wsdl
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id$
|
||||
* @version $Id: Interface.php 16971 2009-07-22 18:05:45Z mikaelkael $
|
||||
*/
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user