|| | |||Browse by category|
http://www.kbpublisher.com - http://www.kbpublisher.com
[b]text[/b] - Bold text.
[u]text[/u] - Underline text.
[i]text[/i] - Italic text.
[color=green]text[/color] - Colored text.
[url]kbpublisher.com[/url] - kbpublisher.com
[url=kbpublisher.com]text[/url] - text
[email]email@example.com[/email] - firstname.lastname@example.org
[h1]text[/h1] - Caption text.
- item 1
- item 2
- item 1
- item 2
The use of restricted Type names in a WSDL or XML Schema will result in naming collisions and compilation errors such as: ?Error: Multiple declaration for <type name>? or ?Error: Redefinition of formal parameter <type name>.?
Naming collisions may occur due to the way that LEIF and Hydra map XML names to C++. The Code Generator (leifgen and rwsfgen respectfully) attempts to work around some of these naming collisions, but the compiler does not always find a satisfactory resolution. This article is relevant to both LEIF and Hydra, however for reasons of simplicity the term ?Hydra? will be used solely in the Action section. The solutions are applicable to LEIF as well as Hydra.
The easiest solution is to simply rename the offending Type to something different. For example, <complexType name=?Attribute?> could be changed to <complexType name="myAttribute">.
If this solution is not viable, it then becomes necessary to utilize the mappings element of the Hydra project file. More information on the project file can be found in the Hydra Web Services Fabrication Guide.
The mappings section of the project file allows for name mapping. A sample mapping to resolve <complexType name=?Attribute?> might look like:
<name xsdname="attribute" xsdtype="" name="myAttribute" namespace=""/>
The mappings element may contain any number of name elements. Please note that by default Hydra will add a mapping for ?choice? to all project files. <name xsdname="choice" xsdtype="" name="ChoiceElement" namespace=""/>. This removes all naming conflicts with Type names of ?choice.?
Please note that LEIF and Hydra will capitalize the first letter of the Type name within the generated code. This is helpful in that it potentially avoids naming collisions with C++ data types and keywords. For example, <complexType name=?void?> will actually generate, class Void;
Capitalizing the entire Type name will negate this benefit and potentially lead to errors if the Type name is the same as a primitive data type. A typical error is: ?Fatal Error: INTERNAL COMPILER ERROR.?
The following Type names will result in naming collisions: Attribute, attribute, BOOL, BYTE, CHAR, DOUBLE, FLOAT, INT, LONG, SHORT, VOID, WCHAR