Development

Changeset 8904

You must first sign up to be able to contribute.

Changeset 8904

Show
Ignore:
Timestamp:
05/10/08 23:19:33 (4 months ago)
Author:
chrisk
Message:

[ckWebServicePlugin] updated README files of both branches

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • plugins/ckWebServicePlugin/branches/1.0/README

    r8753 r8904  
    11= ckWebService plugin = 
    22 
     3'''This is the documentation for the symfony 1.0 compatible plugin version!''' 
     4 
    35The `ckWebServicePlugin` is a symfony plugin that let you expose your modules and actions as a webservice. 
    46 
     
    1820   
    1921  {{{ 
    20     http://svn.symfony-project.com/plugins/ckWebServicePlugin/trunk 
     22    http://svn.symfony-project.com/plugins/ckWebServicePlugin/branches/1.0 
    2123  }}} 
    2224 
     
    203205  The names in the configuration have to be in the same order like the function arguments.  
    204206   
    205   In general a array containing all params can be retrieved by: ''$request->getParameter('param', null, 'ckWebServicePlugin');''. 
     207  In general an array containing all params can be retrieved by: ''$request->getParameter('param', null, 'ckWebServicePlugin');''. 
    206208 
    207209=== Getting the action result === 
    208210 
    209   There are multiple stages of getting the action result. First we try to invoke a implementation of the ''result_callback'' configured in ''app.yml''. 
     211  There are multiple stages of getting the action result. First we try to invoke an implementation of the ''result_callback'' configured in ''app.yml''. 
    210212  If none is found on the action instance a default getter is mixed into the action and is called.  
    211213   
     
    255257== TODO == 
    256258 
     259  * add support for soap headers 
     260  * merge changes to configuration model in symfony 1.1 compatible version back 
    257261  * decide how to handle redirects 
    258   * switch to symfony 1.1 (change the ''wsdl-build'' task, ...) 
    259262  * write tests 
    260263  * rewrite the wsdl generator 
  • plugins/ckWebServicePlugin/trunk/README

    r8555 r8904  
    11= ckWebService plugin = 
    22 
     3'''This is the documentation for the symfony 1.1 compatible plugin version!''' 
     4 
    35The `ckWebServicePlugin` is a symfony plugin that let you expose your modules and actions as a webservice. 
    46 
     
    810 
    911== Installation == 
    10  
    11   To install the current release execute: 
    12    
    13   {{{ 
    14     symfony plugin-install http://plugins.symfony-project.com/ckWebServicePlugin 
    15   }}} 
    16    
    17   or to install the current revision, checkout: 
     12   
     13  To install the current revision, checkout: 
    1814   
    1915  {{{ 
     
    5753=== module.yml === 
    5854 
    59   '''Some of the configuration described here is done by the WSDL Generator!''' 
     55  '''The configuration described here is done by the WSDL Generator!''' 
    6056   
    6157  The plugin allows per action configuration of parameters passed by the soap call so you can use them like request parameters. 
    62   Also you can configure per action in which action member the result is stored, if not set ''result'' is assumed. 
    63  
    64   {{{ 
    65     # your enviroment for web service mode 
    66     soap: 
    67       # the following part is done by the WSDL Generator, you only have to configure this if you don't use the generator 
    68       soap_parameter_map: 
    69         # the action name [mandatory] 
    70         test: 
    71           # the name of the first action parameter 
    72           - test 
    73           # the name of the second, third, ... action parameter 
    74           - second 
    75           - ... 
    76       # set for each action wether or not action views should be rendered as normal, if this isn't set for an action the value from `ck_web_service_plugin: render` in `app.yml` is used 
    77       soap_render_map: 
    78         # the action name [mandatory] 
    79         test: on 
    80       # the name of the action member, which contains the result [optional] 
    81       soap_return_key: result_key 
     58  Also you can configure per action in which action member the result is stored, if not set ''result'' is assumed, and wether or not to render the view as result. 
     59 
     60  {{{ 
     61    # your enviroment for web service mode 
     62    soap: 
     63      # the following part added by the WSDL Generator for each action, you only have to configure this if you don't use the generator 
     64      action_name: 
     65        # enable the action to be called from ckWebServiceController, should prevent malicious calls to actions through manipulated soap messages [mandatory] 
     66        enable: true 
     67        # ordered list of the parameters [optional] 
     68        parameter: [first_param, second_param] 
     69        # the name of the action member, which contains the result, if `render` is true this has no effect [optional] 
     70        result: null 
     71        # set wether or not the view should be rendered as normal, if this isn't set the value from `ck_web_service_plugin: render` in `app.yml` is used [optional] 
     72        render: false 
    8273  }}} 
    8374 
     
    10596  }}} 
    10697 
    107 === php.yml === 
     98=== php.ini === 
    10899 
    109100  Disable wsdl file caching, when your developing to see changes to the wsdl file instantly, this is optional. 
    110101   
    111102  {{{ 
    112     set: 
    113       soap.wsdl_cache_enabled: off 
     103    soap.wsdl_cache_enabled=0 
    114104  }}} 
    115105 
     
    124114  The method names of the web service methods follow the scheme: ''module_Action''. 
    125115   
    126   The generator is used through the ''wsdl-build'' symfony cli task, it has the following syntax: 
    127    
    128   {{{ 
    129     symfony wsdl-build app_name env_name [controller_name] [debug] webservice_name webservice_base_url 
    130   }}} 
    131    
    132   The first four parameters are the same as of the ''init-controller'' task. 
    133    
     116  The generator is used through the ''webservice:generate-wsdl'' symfony cli task, it has the following syntax: 
     117   
     118  {{{ 
     119    symfony webservice:generate-wsdl [--environment=soap] [--debug=on] app_name webservice_name webservice_base_url 
     120  }}} 
     121     
    134122  It will generate a wsdl file and a controller script in the ''web/'' folder and add / modify all ''module.yml'' files of enabled actions. 
    135123 
    136124=== Example === 
    137125 
    138   Howto execute the ''wsdl-build'' task shows the following example: 
    139    
    140   {{{ 
    141     symfony wsdl-build fronted soap myFooBarService http://www.myfoobar.com/ 
    142   }}} 
    143  
    144     * This will add a ''frontend_soap.php'' and a ''myFooBarService.wsdl'' to your ''/web'' folder. 
    145  
    146     * The endpoint for the generated service will be ''http://www.myfoobar.com/frontend_soap.php''. 
     126  Howto execute the ''webservice:generate-wsdl'' task shows the following example: 
     127   
     128  {{{ 
     129    symfony webservice:generate-wsdl frontend myFooBarService http://www.myfoobar.com/ 
     130  }}} 
     131 
     132    * This will add a ''myFooBarService.php'' and a ''myFooBarService.wsdl'' to your ''/web'' folder. 
     133 
     134    * The endpoint for the generated service will be ''http://www.myfoobar.com/myFooBarService.php''. 
    147135     
    148136  Howto enable actions for export shows this example: 
     
    203191  The names in the configuration have to be in the same order like the function arguments.  
    204192   
    205   In general a array containing all params can be retrieved by: ''$request->getParameter('param', null, 'ckWebServicePlugin');''. 
     193  In general an array containing all params can be retrieved by: ''$request->getParameter('param', null, 'ckWebServicePlugin');''. 
    206194 
    207195=== Getting the action result === 
    208196 
    209   There are multiple stages of getting the action result. First we try to invoke a implementation of the ''result_callback'' configured in ''app.yml''. 
    210   If none is found on the action instance a default getter is mixed into the action and is called.  
     197  There are multiple stages of getting the action result. First we try to invoke an implementation of the ''result_callback'' configured in ''app.yml''. 
     198  If none is found on the action instance a default getter is mixed into the action and is called. In this version this is down by listening to the ''component.method_not_found'' event.  
    211199   
    212200  This default getter has the following behavior: 
     
    215203  * when rendering is disabled: 
    216204    * if only one variable exists in the actions parameter holder (set via ''$actionInstance->var = 'some value';''), this variable is returned 
    217     * if a default key into the parameter holder is configured using ''soap_return_key'' in the ''module.yml'' ('''Attention:''' if this is not configured ''result'' is assumed) and this key exists its corresponding value is returned 
     205    * if a default key into the parameter holder is configured using ''soap_return_key'' in the ''module.yml'' ('''Attention:''' if this is not configured ''result'' is assumed) and this key exists, its corresponding value is returned 
    218206    * if both approaches fail nothing is returned  
    219207 
     
    245233    # your enviroment for web service mode 
    246234    soap: 
    247       soap_parameter_map: 
    248         index: 
    249           - foo 
    250           - bar 
     235      index: 
     236        enable: true 
     237        parameter: [foo, bar] 
    251238  }}} 
    252239   
     
    255242== TODO == 
    256243 
     244  * add support for soap headers 
    257245  * decide how to handle redirects 
    258   * switch to symfony 1.1 (change the ''wsdl-build'' task, ...) 
    259246  * write tests 
    260247  * rewrite the wsdl generator