Differences between revisions 2 and 3
Revision 2 as of 2006-07-19 14:14:09
Size: 10278
Editor: dimuthu
Comment:
Revision 3 as of 2009-09-20 23:36:35
Size: 10280
Editor: localhost
Comment: converted to 1.6 markup
Deletions are marked like this. Additions are marked like this.
Line 7: Line 7:
[http://wiki.apache.org/general/DimuthuGamage/GSoC/proposal http://wiki.apache.org/general/DimuthuGamage/GSoC/proposal] [[http://wiki.apache.org/general/DimuthuGamage/GSoC/proposal|http://wiki.apache.org/general/DimuthuGamage/GSoC/proposal]]

Google Summer of Code 2006 – Project Proposal

Project

C Implementation of WSDL2C Code generator for Axis2/C

Project Proposal

http://wiki.apache.org/general/DimuthuGamage/GSoC/proposal

Architecture

This is a diagram which is taken reverse engineering the Axis2/C WSDL2Java Tool

 +---------------------------+      +---------------------------------------+
 | codegen-config-properties |      |  config_property_loader               |
 +---------------------------+      +---------------------------------------+
 | *extension list           |      | get_default_language()                |
 | *suporting languages and  |----->| get_language_emitter_map()            |
 |  corrosponding emitters   |      | get_language_specific_properties_map()|
 | *default language         |      | get_extension_class_names()           |
 | *template to writer map   |      | get_...                               |
 | * ...                     |      +---------------------------------------+
 +---------------------------+                            |
                                                 +-------------------+  
   *w2c main function*-------------------------- |      engine       |
             |                                   +-------------------+
 +---------------------------+                   |    generate()     |
 | cmdline_option_parser     |                   +-------------------+
 +---------------------------+                     /            \ 
             |                                    /              \ 
             |                                   /                \
 +---------------------------+         +-------------------+     +-------------+
 | engine_config_loader      |         |      emitter      |     |  extension  |
 +---------------------------+         |    <interface>    |     | <interface> |
             |                         +-------------------+     +-------------+
             |                         |   emit()          |     | engage()    |
 +---------------------------+         +-------------------+     +-------------+
 | engine_configuration      |                 |
 | (getters and setters)     |                 |
 +---------------------------+         +-------------------+
 | base_uri                  |         |      writer       |
 | output_language           |         |    <interface>    |
 | async_on                  |         +-------------------+
 | sync_on                   |         |   parse()         |
 | package_name              |         +-------------------+
 | server side on            |
 | uri2packagemap            |
 | ...                       |
 +---------------------------+

Some explanation how the tool support code generation for multiple languages

                                                    +--------------------------+ 
+---------------------+   +---------------------+   | codegen.cofig.properties |
| command line options|-- |   codegen engine    |---+--------------------------+
+---------------------+   +---------------------+   | langauge -> emitter map  |
               |                    /            \  | writers -> template map  |
               |                 <load according  \ +--------------------------+
               |             to the command line option> 
     +--------------------------------+       +--------------------------------+
     | emitter for c                  |       | emitter for java script        |
     +--------------------------------+       +--------------------------------+
          /                                              |  
         / <call writers accoding                        | <call writers accoding
        /   to command line options>                     |to command line options> 
       /                                                 |
+-----------+------------------------------+  +---------+-------------------------+
| writers   | templates for c              |  | writers |templates for firefox(js)|
+-----------+------------------------------+  +---------+-------------------------+
| writer1 --> template for service skeleton|  | writer1-->template for main html  | 
| writer2 --> template for skel source     |  +-----------------------------------+
| writer3 --> template for skel header     |        
| writer4 --> template for stub source     |
| writer5 --> template for stub header     |
+------------------------------------------+

Logic flow of the tool

                                     +----------------------+
 +----------------------------+      | select the emitter   |
 | loads command line         |      | to the langugage     |
 | options and configurations |----->| from command line opt|
 |(managed by codegen engine) |      | if no option given   |
 +----------------------------+      | default languag loads|
                                     | (managed by engine)  |
                                     +----------------------+
      +------------------------+       +-------------+
      | engage pre extenstions |       | generatd an |
 ---->| (e.g - wsdl validation,|-----> | intermediate|
      |        data binding    |       | xml-        |
      +------------------------+       + ------------+ 
      +-----------------+     +---------------+
 ---->| load writers    |     |load template  |
      | for the language|---->|from the config|
      +-----------------+     |propery file   |
                              +---------------+
     +-------------------------------------+
     | pass intermidiate xml and template  |    +-----------------------+
---> | for the xslt parser to generate     |--->|engage post extensions |
     | the code                            |    |( e.g - indent the code|
     +-------------------------------------+    +-----------------------+

Timeline in progress

5th July

Today I attached the current code to the JIRA. According to the preliminary schedule I should finish the XML in/out codegeneration by today. Although I could not achive this target, I could get very close to that. Initial sate of intergrating woden for parse wsdl is also implmented. Anyway I should wait untill the API for woden is somewhat frozen to get the xml in/out model code generation working.

This is a list of components currently implemented.

  • wrapper for XSLT procesing with libxslt.
  • dynamic property and configuration readers.
  • pick service names and generate dummy codes ( operations are not picked from wsdl).
  • unit tests for the above components.

19th July

I studied AXIS2/C woden API for fast few weeks. Since It is not fully tested my code are like test cases for the woden C Implementation. Anyway For generated XML in/out model code I designed how I should use the woden API.

There are 2 API for woden. i.e Component API and Element API. Component API provide functions to extract information from WSDL which is sufficent to my work where as the Element API have functions to modify the WSDL additionally.

I created resolver explicitly and continued in the following manner.

       (woden_resolver)
              |
              |
<*WODEN_RESOLVER_READ*-handles wsdl versions> 
              |
              | 
        (woden_desc)
              |
              |
<*WODEN_DESC_GET_SVCS/
       WODEN_WSDL10_DESC_GET_SVCS*>
              |
              | 
   (array_list of woden_svc)
              |
              |
 <*ARRAY_LIST_GET(,,0)*
        -only the first service is considered> 
              |
              | 
         (woden_svc)
              |
              |
<*WODEN_SVC_GET_ENDPOINTS/
       WODEN_WSDL10_SVC_GET_ENDPOINTS*>
              |
              |
   (array_list of woden_endpoint)
              |
              |
 <*ARRAY_LIST_GET(,,0)*
        -only the first endpoint is considered> 
              |
              |
       (woden_endpoint) - >>>>>>>>extract the endpoint information
              |
              |
<*WODEN_ENDPOINT_GET_BINDING/
       WODEN_WSDL10_ENDPOINT_GET_BINDING*>
              |
              |
       (woden_binding) 
              |
              |
<*WODEN_BINDING_GET_BINDING_OPS
        WODEN_WSDL10_BINDING_GET_BINDING_OPS*>
              |
              |
   (array_list of woden_binding_ops)
              |
              |
              +--------------+
              |              |
              | <*ARRAY_LIST_GET(,,i)*
              |         -for each woden_binding_op>
              |              |
              |              |
              |<*WODEN_BINDING_OP_GET_INTERFACE_OP/
              |         WODEN_WSDL10_BINDING_OP_GET_INTERFACE_OP*>
              |              |
              |              |
              |     (woden_interface_ops)
              |              | 
              |              |
              |              +---------<*WODEN_INTERFACE_OP_GET_QNAME*>
              |              |                |
              |              |                +------->>>>>> name
              |              |                |
              |              |                +------->>>>>> namespace
              |              |                |
              |              |                +------->>>>>> style
              |              |
              |              +---------- <*WODEN_INTERFACE_MSG_REF_GET_DIRECTION/      
              |                                WODEN_WSDL10_INTERFACE_MSG_REF_GET_DIRECTION*> 
              _

And I follow the following path to extract the soap actions..

     (woden_binding_op)
             |
             |
<*woden_binding_op_to_element_extensible*>
             |
             |
     (woden_soap_ext_element)
             |
             |
<*WODEN_SOAP_BINDING_OP_EXTS_GET_SOAP_ACTION\
           WODEN_WSDL10_SOAP_BINDING_OP_EXTS_GET_SOAP_ACTION*>
             |
             |
        (axis2_uri)---------->>>>>>>>>> soap action can be extracted

DimuthuGamage/GSoC/progres (last edited 2009-09-20 23:36:35 by localhost)