/**
  * @group ZF-5944
  */
 public function testOnlyPublicPropertiesAreDiscoveredByStrategy()
 {
     $this->strategy->addComplexType("Zend_Soap_Wsdl_DefaultComplexTypeTest_PublicPrivateProtected");
     $xml = $this->wsdl->toXML();
     $this->assertNotContains(Zend_Soap_Wsdl_DefaultComplexTypeTest_PublicPrivateProtected::PROTECTED_VAR_NAME, $xml);
     $this->assertNotContains(Zend_Soap_Wsdl_DefaultComplexTypeTest_PublicPrivateProtected::PRIVATE_VAR_NAME, $xml);
 }
 /**
  * @group ZF-5944
  */
 public function testOnlyPublicPropertiesAreDiscoveredByStrategy()
 {
     $this->strategy->addComplexType('\\ZendTest\\Soap\\Wsdl\\PublicPrivateProtected');
     $xml = $this->wsdl->toXML();
     $this->assertNotContains(PublicPrivateProtected::PROTECTED_VAR_NAME, $xml);
     $this->assertNotContains(PublicPrivateProtected::PRIVATE_VAR_NAME, $xml);
 }
Example #3
0
 /**
  * Add an ArrayOfType based on the xsd:complexType syntax if type[] is detected in return value doc comment.
  *
  * @param string $type
  * @return string tns:xsd-type
  */
 public function addComplexType($type)
 {
     if (in_array($type, $this->_inProcess)) {
         // require_once "Zend/Soap/Wsdl/Exception.php";
         throw new Zend_Soap_Wsdl_Exception("Infinite recursion, cannot nest '" . $type . "' into itsself.");
     }
     $this->_inProcess[$type] = $type;
     $nestingLevel = $this->_getNestedCount($type);
     if ($nestingLevel > 1) {
         // require_once "Zend/Soap/Wsdl/Exception.php";
         throw new Zend_Soap_Wsdl_Exception("ArrayOfTypeComplex cannot return nested ArrayOfObject deeper than " . "one level. Use array object properties to return deep nested data.\n            ");
     }
     $singularType = $this->_getSingularPhpType($type);
     if (!class_exists($singularType)) {
         // require_once "Zend/Soap/Wsdl/Exception.php";
         throw new Zend_Soap_Wsdl_Exception(sprintf("Cannot add a complex type %s that is not an object or where " . "class could not be found in 'DefaultComplexType' strategy.", $type));
     }
     if ($nestingLevel == 1) {
         // The following blocks define the Array of Object structure
         $xsdComplexTypeName = $this->_addArrayOfComplexType($singularType, $type);
     } else {
         $xsdComplexTypeName = $singularType;
     }
     // The array for the objects has been created, now build the object definition:
     if (!in_array($singularType, $this->getContext()->getTypes())) {
         parent::addComplexType($singularType);
     }
     unset($this->_inProcess[$type]);
     return "tns:" . $xsdComplexTypeName;
 }
Example #4
0
    /**
     * Add an unbounded ArrayOfType based on the xsd:sequence syntax if type[] is detected in return value doc comment.
     *
     * @param string $type
     * @return string tns:xsd-type
     */
    public function addComplexType($type)
    {
        $nestedCounter = $this->_getNestedCount($type);

        if($nestedCounter > 0) {
            $singularType = $this->_getSingularType($type);

            for($i = 1; $i <= $nestedCounter; $i++) {
                $complexTypeName = substr($this->_getTypeNameBasedOnNestingLevel($singularType, $i), 4);
                $childTypeName = $this->_getTypeNameBasedOnNestingLevel($singularType, $i-1);

                $this->_addElementFromWsdlAndChildTypes($complexTypeName, $childTypeName);
            }
            // adding the PHP type which is resolved to a nested XSD type. therefore add only once.
            $this->getContext()->addType($complexTypeName);

            return "tns:$complexTypeName";
        } else if (!in_array($type, $this->getContext()->getTypes())) {
            // New singular complex type
            return parent::addComplexType($type);
        } else {
            // Existing complex type
            return $this->getContext()->getType($type);
        }
    }