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 "Michael Koch (JIRA)" <ax...@ws.apache.org> on 2006/10/18 15:02:34 UTC
[jira] Created: (AXISCPP-1003) Enumeration with spaces in values
generates invalid hpp file
Enumeration with spaces in values generates invalid hpp file
------------------------------------------------------------
Key: AXISCPP-1003
URL: http://issues.apache.org/jira/browse/AXISCPP-1003
Project: Axis-C++
Issue Type: Bug
Affects Versions: 1.6 Beta
Environment: Axis-CPP: axis-c-1.6b-Win32-trace-bin
Compiler: gcc (GCC) 3.4.4 (cygming special) (gdc 0.12, using dmd 0.125)
Reporter: Michael Koch
When I set an enumeration value which contains spaces on a type, the hpp file for the type does not compile. The space in the enumeration value seems to translate to an incorrect static const generation. I'll attach a test case.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-dev-help@ws.apache.org
[jira] Commented: (AXISCPP-1003) Enumeration with spaces in values
generates invalid hpp file
Posted by "Michael Koch (JIRA)" <ax...@ws.apache.org>.
[ http://issues.apache.org/jira/browse/AXISCPP-1003?page=comments#action_12443731 ]
Michael Koch commented on AXISCPP-1003:
---------------------------------------
Perhaps the behaviour of Axis-Java (coming from the JAX-RPC specification) should be emulated. Enum values are mapped to constant names in a scheme similar to the one described in the previous comment only if at least one of the values is not a legal identifier name. The advantage would be that the code generated by a new Axis-C++ release for enumerations would be compatible by the one generated by earlier versions. The disadvantage of this scheme is that existing code will break if a schema is extended to include additional enumeration values which are not legal identifiers.
A general disadvantage of the numbering scheme is that generated code will compile but break at runtime if the schema is extended with new enumeration values not by appending them but by adding them in between, for example because the schema author likes to have his enumeration values in alphabetical order. Since JAX-RPC code has the same problem, there has probably been already a lot of discussion to this issue there.
Since I don't really have a better solution, I'd vote for the fix from the previous comment, since the first priority should be to generate correct code.
> Enumeration with spaces in values generates invalid hpp file
> ------------------------------------------------------------
>
> Key: AXISCPP-1003
> URL: http://issues.apache.org/jira/browse/AXISCPP-1003
> Project: Axis-C++
> Issue Type: Bug
> Affects Versions: 1.6 Beta
> Environment: Axis-CPP: axis-c-1.6b-Win32-trace-bin
> Compiler: gcc (GCC) 3.4.4 (cygming special) (gdc 0.12, using dmd 0.125)
> Reporter: Michael Koch
> Assigned To: nadir amra
> Attachments: testcase2.wsdl
>
>
> When I set an enumeration value which contains spaces on a type, the hpp file for the type does not compile. The space in the enumeration value seems to translate to an incorrect static const generation. I'll attach a test case.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-dev-help@ws.apache.org
[jira] Assigned: (AXISCPP-1003) Enumeration with spaces in values
generates invalid hpp file
Posted by "nadir amra (JIRA)" <ax...@ws.apache.org>.
[ http://issues.apache.org/jira/browse/AXISCPP-1003?page=all ]
nadir amra reassigned AXISCPP-1003:
-----------------------------------
Assignee: nadir amra
> Enumeration with spaces in values generates invalid hpp file
> ------------------------------------------------------------
>
> Key: AXISCPP-1003
> URL: http://issues.apache.org/jira/browse/AXISCPP-1003
> Project: Axis-C++
> Issue Type: Bug
> Affects Versions: 1.6 Beta
> Environment: Axis-CPP: axis-c-1.6b-Win32-trace-bin
> Compiler: gcc (GCC) 3.4.4 (cygming special) (gdc 0.12, using dmd 0.125)
> Reporter: Michael Koch
> Assigned To: nadir amra
> Attachments: testcase2.wsdl
>
>
> When I set an enumeration value which contains spaces on a type, the hpp file for the type does not compile. The space in the enumeration value seems to translate to an incorrect static const generation. I'll attach a test case.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-dev-help@ws.apache.org
[jira] Commented: (AXISCPP-1003) Enumeration with spaces in values
generates invalid hpp file
Posted by "nadir amra (JIRA)" <ax...@ws.apache.org>.
[ http://issues.apache.org/jira/browse/AXISCPP-1003?page=comments#action_12443705 ]
nadir amra commented on AXISCPP-1003:
-------------------------------------
One way to fix this is ensureing that spaces get converted to '_'.
Probably a better way is for the enumeration variable name to be constructed as:
[type]_enum[#]
where [type] is the type and [#] is a number, starting from 1.
For example, in this case it would be
static const FooType FooType_enum1 = "foo bar";
The only thing I worry about the latter solution is that I may break someone? Is that possible? If so, then I would go with the first solution.
> Enumeration with spaces in values generates invalid hpp file
> ------------------------------------------------------------
>
> Key: AXISCPP-1003
> URL: http://issues.apache.org/jira/browse/AXISCPP-1003
> Project: Axis-C++
> Issue Type: Bug
> Affects Versions: 1.6 Beta
> Environment: Axis-CPP: axis-c-1.6b-Win32-trace-bin
> Compiler: gcc (GCC) 3.4.4 (cygming special) (gdc 0.12, using dmd 0.125)
> Reporter: Michael Koch
> Attachments: testcase2.wsdl
>
>
> When I set an enumeration value which contains spaces on a type, the hpp file for the type does not compile. The space in the enumeration value seems to translate to an incorrect static const generation. I'll attach a test case.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-dev-help@ws.apache.org
[jira] Commented: (AXISCPP-1003) Enumeration with spaces in values
generates invalid hpp file
Posted by "nadir amra (JIRA)" <ax...@ws.apache.org>.
[ http://issues.apache.org/jira/browse/AXISCPP-1003?page=comments#action_12443725 ]
nadir amra commented on AXISCPP-1003:
-------------------------------------
I guess I have chosen the solution to be:
[type]_ENUM_[#]
For example,
static const FooType FooType_ENUM_1 = "foo bar";
Fix should be put to SVN tomorrow, unless there are any objections.
> Enumeration with spaces in values generates invalid hpp file
> ------------------------------------------------------------
>
> Key: AXISCPP-1003
> URL: http://issues.apache.org/jira/browse/AXISCPP-1003
> Project: Axis-C++
> Issue Type: Bug
> Affects Versions: 1.6 Beta
> Environment: Axis-CPP: axis-c-1.6b-Win32-trace-bin
> Compiler: gcc (GCC) 3.4.4 (cygming special) (gdc 0.12, using dmd 0.125)
> Reporter: Michael Koch
> Assigned To: nadir amra
> Attachments: testcase2.wsdl
>
>
> When I set an enumeration value which contains spaces on a type, the hpp file for the type does not compile. The space in the enumeration value seems to translate to an incorrect static const generation. I'll attach a test case.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-dev-help@ws.apache.org
[jira] Updated: (AXISCPP-1003) Enumeration with spaces in values
generates invalid hpp file
Posted by "Michael Koch (JIRA)" <ax...@ws.apache.org>.
[ http://issues.apache.org/jira/browse/AXISCPP-1003?page=all ]
Michael Koch updated AXISCPP-1003:
----------------------------------
Attachment: testcase2.wsdl
The wsdl file contains a type definition FooType which has "foo bar" as single enumeration value. The C++ code generated by wsdl2ws does not compile. The offending line is in FooType.hpp:
static const FooType FooType_foo bar = "foo bar";
> Enumeration with spaces in values generates invalid hpp file
> ------------------------------------------------------------
>
> Key: AXISCPP-1003
> URL: http://issues.apache.org/jira/browse/AXISCPP-1003
> Project: Axis-C++
> Issue Type: Bug
> Affects Versions: 1.6 Beta
> Environment: Axis-CPP: axis-c-1.6b-Win32-trace-bin
> Compiler: gcc (GCC) 3.4.4 (cygming special) (gdc 0.12, using dmd 0.125)
> Reporter: Michael Koch
> Attachments: testcase2.wsdl
>
>
> When I set an enumeration value which contains spaces on a type, the hpp file for the type does not compile. The space in the enumeration value seems to translate to an incorrect static const generation. I'll attach a test case.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-dev-help@ws.apache.org