protected function _addService(Zend_Server_Reflection_Class $refclass, DOMElement $target)
    {
        foreach ($refclass->getMethods() as $method) {
            if (!$method->isPublic()
                || $method->isConstructor()
                || ('__' == substr($method->name, 0, 2))
            ) {
                continue;
            }

            foreach ($method->getPrototypes() as $proto) {
                $op = $this->_xml->createElement('operation');
                $op->setAttribute('name', $method->getName());

                $rettype = $this->_registerType($proto->getReturnType());
                $op->setAttribute('returnType', $rettype);

                foreach ($proto->getParameters() as $param) {
                    $arg = $this->_xml->createElement('argument');
                    $arg->setAttribute('name', $param->getName());

                    $type = $param->getType();
                    if ($type == 'mixed' && ($pclass = $param->getClass())) {
                        $type = $pclass->getName();
                    }

                    $ptype = $this->_registerType($type);
                    $arg->setAttribute('type', $ptype);

                    if($param->isDefaultValueAvailable()) {
                        $arg->setAttribute('defaultvalue', $param->getDefaultValue());
                    }

                    $op->appendChild($arg);
                }

                $target->appendChild($op);
            }
        }
    }
protected function _addService(Zend_Server_Reflection_Class $refclass, DOMElement $target)
    {
        foreach ($refclass->getMethods() as $method) {
            if (!$method->isPublic()
                || $method->isConstructor()
                || ('__' == substr($method->name, 0, 2))
            ) {
                continue;
            }

            foreach ($method->getPrototypes() as $proto) {
                $op = $this->_xml->createElement('operation');
                $op->setAttribute('name', $method->getName());

                $rettype = $this->_registerType($proto->getReturnType());
                $op->setAttribute('returnType', $rettype);

                foreach ($proto->getParameters() as $param) {
                    $arg = $this->_xml->createElement('argument');
                    $arg->setAttribute('name', $param->getName());

                    $type = $param->getType();
                    if ($type == 'mixed' && ($pclass = $param->getClass())) {
                        $type = $pclass->getName();
                    }

                    $ptype = $this->_registerType($type);
                    $arg->setAttribute('type', $ptype);

                    if($param->isDefaultValueAvailable()) {
                        $arg->setAttribute('defaultvalue', $param->getDefaultValue());
                    }

                    $op->appendChild($arg);
                }

                $target->appendChild($op);
            }
        }
    }
protected function _addService ( Zend_Server_Reflection_Class $ refclass , DOMElement $ target ) { foreach ( $ refclass -> getMethods ( ) as $ method ) { if ( ! $ method -> isPublic ( ) || $ method -> isConstructor ( ) || ( '__' == substr ( $ method -> name , 0 , 2 ) ) ) { continue ; } foreach ( $ method -> getPrototypes ( ) as $ proto ) { $ op = $ this -> _xml -> createElement ( 'operation' ) ; $ op -> setAttribute ( 'name' , $ method -> getName ( ) ) ; $ rettype = $ this -> _registerType ( $ proto -> getReturnType ( ) ) ; $ op -> setAttribute ( 'returnType' , $ rettype ) ; foreach ( $ proto -> getParameters ( ) as $ param ) { $ arg = $ this -> _xml -> createElement ( 'argument' ) ; $ arg -> setAttribute ( 'name' , $ param -> getName ( ) ) ; $ type = $ param -> getType ( ) ; if ( $ type == 'mixed' && ( $ pclass = $ param -> getClass ( ) ) ) { $ type = $ pclass -> getName ( ) ; } $ ptype = $ this -> _registerType ( $ type ) ; $ arg -> setAttribute ( 'type' , $ ptype ) ; if ( $ param -> isDefaultValueAvailable ( ) ) { $ arg -> setAttribute ( 'defaultvalue' , $ param -> getDefaultValue ( ) ) ; } $ op -> appendChild ( $ arg ) ; } $ target -> appendChild ( $ op ) ; } } }
Build XML service description from reflection class

@param  Zend_Server_Reflection_Class $refclass
@param  DOMElement $target target XML element
@return void
Build XML service description from reflection class