Menu

#1312 Default attributes in XML schema not captured by WSDL2H

v1.0 (example)
open
5
2023-09-08
2023-09-08
No

Hi.
I recently updated from gSOAP 2.8.26 to 2.8.130, and I think there is a regression in the way wsdl2h handles default attributes, when setting the c++11 flag or higher. I am using wsdl2h to generate header files from my XML schemas.
Default attributes of some types, like xs:boolean are handled fine, but if an attribute is of some user-defined type, say a restriction on a string, this is not captured, and the default enum value is not captured in the generated header file.

After testing, the problem is twofold, but should be solvable with a patch to wsdl/types.cpp:

  • In the function Types::ename, with the c11flag set, enum names are no longer inserted in the enames map, which the function Types::defename does as a side effect.
  • The function Types::ctype must recognize the token as an enum. The easiest way to do this would be to bring back the enum keyword in the class definitions before all enum class members, even though it is not required. Then the token will be recognized as an enum and handled correctly.

Let me know if you need more info!

Discussion


Log in to post a comment.

MongoDB Logo MongoDB