Zend Framework 2自动发现复杂类型

时间:2015-08-05 16:59:05

标签: php zend-framework2

有人管理从类创建复杂类型。我有下一个错误

  

PHP致命错误:调用成员函数getTypes()

$complex_type_strategy = new \Zend\Soap\Wsdl\ComplexTypeStrategy\DefaultComplexType();
$complex_type_strategy->addComplexType('className');
$autodiscover->setComplexTypeStrategy($complex_type_strategy);

.....

class className {
    /**
    * @var string $field
    */
    public $field;
}

由于

1 个答案:

答案 0 :(得分:1)

尝试以这种方式:

<?php

use Zend\Soap\Wsdl\ComplexTypeStrategy\ArrayOfTypeComplex;

$autodiscover = new AutoDiscover(new ArrayOfTypeComplex());
$autodiscover->setClassMap(array('Application\Class\Document'));
$autodiscover->setUri('http://myws.me/ws');
$autodiscover->handle();