Changeset 496

Show
Ignore:
Timestamp:
04/13/07 15:01:11 (2 years ago)
Author:
schst
Message:

Added @WebMethod? annotation and check in JsonRpcProcessor?

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/main/php/_test/BuddyQuoteService.php

    r427 r496  
    44 * 
    55 * @author      Richard Sternagel 
     6 * @author      Stephan Schmidt 
    67 * @package     stubbles 
    7  * @subpackage  websites 
     8 * @subpackage  examples 
    89 */ 
    910 
    1011class BuddyQuoteService { 
    11      
    12     protected $buddyQuotes = array(  
     12 
     13    protected $buddyQuotes = array( 
    1314                                    'Banane im Trompetenrohr kommt zum Glück sehr selten vor.', 
    1415                                    'Banane auf dem Sofakissen muss man wohl entfernen müssen', 
     
    2021                                   ); 
    2122 
     23    /** 
     24     * Get a quote 
     25     * 
     26     * @WebMethod 
     27     * @param int $arrKey 
     28     * @return string 
     29     */ 
    2230    public function getQuote($arrKey) { 
    2331        return $this->buddyQuotes[$arrKey]; 
  • trunk/src/main/php/net/stubbles/websites/processors/stubJsonRpcProcessor.php

    r487 r496  
    99 */ 
    1010stubClassLoader::load('net.stubbles.websites.processors.stubAbstractProcessor', 
    11                       'net.stubbles.util.validators.stubRegexValidator'); 
     11                      'net.stubbles.util.validators.stubRegexValidator', 
     12                      'net.stubbles.service.annotations.stubWebMethodAnnotation'); 
    1213 
    1314/** 
     
    1819 * @package     stubbles 
    1920 * @subpackage  websites_processors 
    20  * @todo        paramAnnotation could define an individual Range for the RegExValidator 
    2121 * @todo        Finish refactoring 
    2222 * @todo        Make methods testable 
    23  * @todo        Check for annotations 
    2423 * @todo        Do not validate the RAW POST Data using a regexp, as json_decode does enough validation 
    2524 */ 
     
    127126        if ($method == null) { 
    128127            throw new stubException('Unknown method ' . $className . '.' . $methodName . '.'); 
     128        } 
     129        if (!$method->hasAnnotation('WebMethod')) { 
     130            throw new stubException('Method ' . $className . '.' . $methodName . ' is no WebMethod.'); 
    129131        } 
    130132        if ($method->getNumberOfRequiredParameters() > count($params)) {