You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@axis.apache.org by "Damitha Kumarage (JIRA)" <ji...@apache.org> on 2007/12/06 12:26:43 UTC

[jira] Assigned: (AXIS2C-779) WSDL2C generates invalid function prototypes when WSDL operation name is a C/C++ reserved word

     [ https://issues.apache.org/jira/browse/AXIS2C-779?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Damitha Kumarage reassigned AXIS2C-779:
---------------------------------------

    Assignee: Dimuthu Gamage

> WSDL2C generates invalid function prototypes when WSDL operation name is a C/C++ reserved word
> ----------------------------------------------------------------------------------------------
>
>                 Key: AXIS2C-779
>                 URL: https://issues.apache.org/jira/browse/AXIS2C-779
>             Project: Axis2-C
>          Issue Type: Improvement
>          Components: code generation
>    Affects Versions: Current (Nightly)
>         Environment: Windows XP, Visual Studio 2005
>            Reporter: Bill Mitchell
>            Assignee: Dimuthu Gamage
>            Priority: Minor
>         Attachments: service.wsdl
>
>
> When given a WSDL with a operation with the name "delete", WSDL2C generates a function prototype for the operation using "delete" as the name of a formal parameter.  Of course, the C++ compiler processing the header considers this an invalid use of a reserved word.  
> In particular, let the WSDL contain an operation definition of the form:
> ... 
>   <operation name="delete"> 
>     <input message="fw:deleteRequest"/> 
>     <output message="fw:deleteResponse"/> 
>   </operation> 
> ... 
> The generated prototype looks like this:
> The template in the header for the stub for this operation is: 
>   axiom_node_t* axis2_stub_Fservice_delete( axis2_stub_t *stub, const axutil_env_t *env, 
>                                                     axiom_node_t* delete); 
> I have verified that the same problem arises with words from the C reserved word list.  If the operation name is "struct", then the formal parameter name is also "struct", in both the generated .h and .c files.  
> At least 3 approaches to resolving the problem are possible:
> (1) Always prefix the names used in the formal parameters with a fixed Axis2 string, e.g., "op_".  
> (2) Replace names with a substitute when they are found to conflict with a word in the C/C++ reserved word list. 
> (3) Prefix all names from the WSDL with a string representing the namespace, so that every name is of the form nsstring_name, where even the default namespace is replaced with some nsstring.  
> Where solution (3) might solve a general class of conflcts of names across namespaces as well as this specific issue, for this one issue of the formal parameter to the operation stub solution (1) should be adequate.  
> The workaround, where the user is not able to change the WSDL itself, is to hand massage the generated .h and .c files after code generation wherever the conflict arises and the compiler diagnoses the error.  

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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