axis-c-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Samisa Abeysinghe <samisa.abeysin...@gmail.com>
Subject Re: [axis2]mapping convension from wsdl elememt names to c literal names
Date Sat, 12 Aug 2006 13:17:53 GMT
Dimuthu Chathuranga wrote:
>
> hi all,
>
> Axis2/C code-generation requires a convention for mapping from wsdl 
> element names to c literal names. because according to axis2/c code 
> convention the function names, variables and types should be all 
> simple and macros should be all capital. (This is not effect to the 
> qnames of the element).
>
What does the Java tool do in this case? Does it use the same  element 
names appearing in the WSDL for literal names, or do they apply some 
convention  and convert the stuff to some agreed format?

I am asking this, because while I agree that it is good to adhere to the 
C style code in the generated code, I also would anticipate that at 
times users would have to look into the WSDL and the generated code and 
identify the relationship between them. In this case, it would be easier 
to have the same naming both in the generated C code and in the WSDL. Or 
else we have to have comments in the generated code that help establish 
the relationship.

Thanks,
Samisa...
>
> So I suggest following convention:
>
> 1. isolated capital letters will be replaced by '_'(underscore) and 
> corresponding simple letter except for the first letter.
>
> e.g: echoString -> echo_string
>
> 2. if there are capital letters in a sequence only the first will be 
> replaced. ( this is also except for the first letter).
>
> e.g: echoSTRING -> echo_string
>
> if there are conflicts occurring we can give a option to ignore the 
> conversion.
>
>  
>
> And I suggest function names of the generated code always prefix in 
> following way.
>
> for stub:
> axis2_stub_<service_name>
>  
> for skel:
> axis2_skel_<service_name> &
> axis2_svc_skel_<service_name>
>
> here I m attaching generated stubs for the InteropTestRound1Doc.wsdl 
> using these convention..( the wsdls are in test/resources/wsdl in 
> axis2/c svn)
>
> regards
> dimuthu
> ------------------------------------------------------------------------
>
>
>
>         /**
>         * axis2_stub_interop_test_port_type_doc_service.h
>         *
>         * This file was auto-generated from WSDL for Axis2/C - stub code
>         * by the Apache Axis2/Java version: #axisVersion# #today#
>         */
>
>         #include <stdio.h>
>         #include <axiom.h>
>         #include <axis2_util.h>
>         #include <axiom_soap.h>
>         #include <axis2_client.h>
>         #include <axis2_stub.h>
>
>        
>         /* function prototypes - for header file*/
>         /**
>          * axis2_stub_interop_test_port_type_doc_service_create
>          * create and return the stub with services populated
>          * params - env : environment ( mandatory)
>          *        - client_home : Axis2/C home ( mandatory )
>          *        - endpoint_uri : service endpoint uri( optional ) - if NULL default
picked from wsdl used
>          */
>         axis2_stub_t*
>         axis2_stub_interop_test_port_type_doc_service_create (const axis2_env_t *env,
>                                         axis2_char_t *client_home,
>                                         axis2_char_t *endpoint_uri);
>         /**
>          * axis2_stub_interop_test_port_type_doc_service_populate_services
>          * populate the svc in stub with the service and operations
>          */
>         void axis2_stub_interop_test_port_type_doc_service_populate_services( axis2_stub_t
*stub, const axis2_env_t *env);
>         /**
>          * axis2_stub_interop_test_port_type_doc_service_get_endpoint_uri_from_wsdl
>          * return the endpoint URI picked from wsdl
>          */
>         axis2_char_t *axis2_stub_interop_test_port_type_doc_service_get_endpoint_uri_from_wsdl
( const axis2_env_t *env );
>
>         axiom_node_t* axis2_stub_interop_test_port_type_doc_service_echo_string( axis2_stub_t
*stub, const axis2_env_t *env  ,
>                                                 axiom_node_t* param1);
>         axiom_node_t* axis2_stub_interop_test_port_type_doc_service_echo_string_array(
axis2_stub_t *stub, const axis2_env_t *env  ,
>                                                 axiom_node_t* param1);
>         axiom_node_t* axis2_stub_interop_test_port_type_doc_service_echo_integer( axis2_stub_t
*stub, const axis2_env_t *env  ,
>                                                 axiom_node_t* param1);
>         axiom_node_t* axis2_stub_interop_test_port_type_doc_service_echo_integer_array(
axis2_stub_t *stub, const axis2_env_t *env  ,
>                                                 axiom_node_t* param1);
>         axiom_node_t* axis2_stub_interop_test_port_type_doc_service_echo_float( axis2_stub_t
*stub, const axis2_env_t *env  ,
>                                                 axiom_node_t* param1);
>         axiom_node_t* axis2_stub_interop_test_port_type_doc_service_echo_float_array(
axis2_stub_t *stub, const axis2_env_t *env  ,
>                                                 axiom_node_t* param1);
>         axiom_node_t* axis2_stub_interop_test_port_type_doc_service_echo_struct( axis2_stub_t
*stub, const axis2_env_t *env  ,
>                                                 axiom_node_t* param1);
>         axiom_node_t* axis2_stub_interop_test_port_type_doc_service_echo_struct_array(
axis2_stub_t *stub, const axis2_env_t *env  ,
>                                                 axiom_node_t* param1);
>         axiom_node_t* axis2_stub_interop_test_port_type_doc_service_echo_void( axis2_stub_t
*stub, const axis2_env_t *env  ,
>                                                 axiom_node_t* param1);
>         axiom_node_t* axis2_stub_interop_test_port_type_doc_service_echo_base64( axis2_stub_t
*stub, const axis2_env_t *env  ,
>                                                 axiom_node_t* param1);
>         axiom_node_t* axis2_stub_interop_test_port_type_doc_service_echo_date( axis2_stub_t
*stub, const axis2_env_t *env  ,
>                                                 axiom_node_t* param1);
>         axiom_node_t* axis2_stub_interop_test_port_type_doc_service_echo_hex_binary(
axis2_stub_t *stub, const axis2_env_t *env  ,
>                                                 axiom_node_t* param1);
>         axiom_node_t* axis2_stub_interop_test_port_type_doc_service_echo_decimal( axis2_stub_t
*stub, const axis2_env_t *env  ,
>                                                 axiom_node_t* param1);
>         axiom_node_t* axis2_stub_interop_test_port_type_doc_service_echo_boolean( axis2_stub_t
*stub, const axis2_env_t *env  ,
>                                                 axiom_node_t* param1);
>         
>         void axis2_stub_interop_test_port_type_doc_service_echo_string_start( axis2_stub_t
*stub, const axis2_env_t *env, axiom_node_t* param1,
>                                                     axis2_status_t ( AXIS2_CALL *on_complete
) (struct axis2_callback *, const axis2_env_t* ) ,
>                                                     axis2_status_t ( AXIS2_CALL *on_error
) (struct axis2_callback *, const axis2_env_t*, int ) );
>
>         
>         void axis2_stub_interop_test_port_type_doc_service_echo_string_array_start( axis2_stub_t
*stub, const axis2_env_t *env, axiom_node_t* param1,
>                                                     axis2_status_t ( AXIS2_CALL *on_complete
) (struct axis2_callback *, const axis2_env_t* ) ,
>                                                     axis2_status_t ( AXIS2_CALL *on_error
) (struct axis2_callback *, const axis2_env_t*, int ) );
>
>         
>         void axis2_stub_interop_test_port_type_doc_service_echo_integer_start( axis2_stub_t
*stub, const axis2_env_t *env, axiom_node_t* param1,
>                                                     axis2_status_t ( AXIS2_CALL *on_complete
) (struct axis2_callback *, const axis2_env_t* ) ,
>                                                     axis2_status_t ( AXIS2_CALL *on_error
) (struct axis2_callback *, const axis2_env_t*, int ) );
>
>         
>         void axis2_stub_interop_test_port_type_doc_service_echo_integer_array_start(
axis2_stub_t *stub, const axis2_env_t *env, axiom_node_t* param1,
>                                                     axis2_status_t ( AXIS2_CALL *on_complete
) (struct axis2_callback *, const axis2_env_t* ) ,
>                                                     axis2_status_t ( AXIS2_CALL *on_error
) (struct axis2_callback *, const axis2_env_t*, int ) );
>
>         
>         void axis2_stub_interop_test_port_type_doc_service_echo_float_start( axis2_stub_t
*stub, const axis2_env_t *env, axiom_node_t* param1,
>                                                     axis2_status_t ( AXIS2_CALL *on_complete
) (struct axis2_callback *, const axis2_env_t* ) ,
>                                                     axis2_status_t ( AXIS2_CALL *on_error
) (struct axis2_callback *, const axis2_env_t*, int ) );
>
>         
>         void axis2_stub_interop_test_port_type_doc_service_echo_float_array_start( axis2_stub_t
*stub, const axis2_env_t *env, axiom_node_t* param1,
>                                                     axis2_status_t ( AXIS2_CALL *on_complete
) (struct axis2_callback *, const axis2_env_t* ) ,
>                                                     axis2_status_t ( AXIS2_CALL *on_error
) (struct axis2_callback *, const axis2_env_t*, int ) );
>
>         
>         void axis2_stub_interop_test_port_type_doc_service_echo_struct_start( axis2_stub_t
*stub, const axis2_env_t *env, axiom_node_t* param1,
>                                                     axis2_status_t ( AXIS2_CALL *on_complete
) (struct axis2_callback *, const axis2_env_t* ) ,
>                                                     axis2_status_t ( AXIS2_CALL *on_error
) (struct axis2_callback *, const axis2_env_t*, int ) );
>
>         
>         void axis2_stub_interop_test_port_type_doc_service_echo_struct_array_start( axis2_stub_t
*stub, const axis2_env_t *env, axiom_node_t* param1,
>                                                     axis2_status_t ( AXIS2_CALL *on_complete
) (struct axis2_callback *, const axis2_env_t* ) ,
>                                                     axis2_status_t ( AXIS2_CALL *on_error
) (struct axis2_callback *, const axis2_env_t*, int ) );
>
>         
>         void axis2_stub_interop_test_port_type_doc_service_echo_void_start( axis2_stub_t
*stub, const axis2_env_t *env, axiom_node_t* param1,
>                                                     axis2_status_t ( AXIS2_CALL *on_complete
) (struct axis2_callback *, const axis2_env_t* ) ,
>                                                     axis2_status_t ( AXIS2_CALL *on_error
) (struct axis2_callback *, const axis2_env_t*, int ) );
>
>         
>         void axis2_stub_interop_test_port_type_doc_service_echo_base64_start( axis2_stub_t
*stub, const axis2_env_t *env, axiom_node_t* param1,
>                                                     axis2_status_t ( AXIS2_CALL *on_complete
) (struct axis2_callback *, const axis2_env_t* ) ,
>                                                     axis2_status_t ( AXIS2_CALL *on_error
) (struct axis2_callback *, const axis2_env_t*, int ) );
>
>         
>         void axis2_stub_interop_test_port_type_doc_service_echo_date_start( axis2_stub_t
*stub, const axis2_env_t *env, axiom_node_t* param1,
>                                                     axis2_status_t ( AXIS2_CALL *on_complete
) (struct axis2_callback *, const axis2_env_t* ) ,
>                                                     axis2_status_t ( AXIS2_CALL *on_error
) (struct axis2_callback *, const axis2_env_t*, int ) );
>
>         
>         void axis2_stub_interop_test_port_type_doc_service_echo_hex_binary_start( axis2_stub_t
*stub, const axis2_env_t *env, axiom_node_t* param1,
>                                                     axis2_status_t ( AXIS2_CALL *on_complete
) (struct axis2_callback *, const axis2_env_t* ) ,
>                                                     axis2_status_t ( AXIS2_CALL *on_error
) (struct axis2_callback *, const axis2_env_t*, int ) );
>
>         
>         void axis2_stub_interop_test_port_type_doc_service_echo_decimal_start( axis2_stub_t
*stub, const axis2_env_t *env, axiom_node_t* param1,
>                                                     axis2_status_t ( AXIS2_CALL *on_complete
) (struct axis2_callback *, const axis2_env_t* ) ,
>                                                     axis2_status_t ( AXIS2_CALL *on_error
) (struct axis2_callback *, const axis2_env_t*, int ) );
>
>         
>         void axis2_stub_interop_test_port_type_doc_service_echo_boolean_start( axis2_stub_t
*stub, const axis2_env_t *env, axiom_node_t* param1,
>                                                     axis2_status_t ( AXIS2_CALL *on_complete
) (struct axis2_callback *, const axis2_env_t* ) ,
>                                                     axis2_status_t ( AXIS2_CALL *on_error
) (struct axis2_callback *, const axis2_env_t*, int ) );
>
>         
> ------------------------------------------------------------------------
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-c-dev-help@ws.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-dev-help@ws.apache.org


Mime
View raw message