Web Service Development Guide : PART V HydraExpress Reference : Chapter 20 The HydraExpress Code Generator : Generating Code with Multiple Schemas or WSDLs
Generating Code with Multiple Schemas or WSDLs
The HydraExpress code generator can take as input any number or combination of XML Schemas or WSDLs to support any application architecture you wish.
The syntax for invoking the generator is the same, regardless of the number of WSDLs or schemas supplied to the generator. Depending on the location of your files, you will likely use a complete path to each file, such as:
 
prompt>rwsfgen -projectname MyProject
D:\HydraExpress\examples\xmlbinding\basic\po.xsd
D:\HydraExpress\examples\webservices\Fault\Fault.wsdl
D:\HydraExpress\examples\webservices\Handlers\Handlers.wsdl
This directive compiles the po.xsd schema and also creates server and client code for the two WSDLs Fault.wsdl and Handlers.wsdl, generating all code into a directory MyProject.
Note that you do not need to include schema files that are imported in a WSDL file.
Using multiple WSDLs or schemas retains the same directory structure as using just one file as input, simply placing all generated code into the relevant subdirectories.
Separate directories under the data directory are created for each namespace represented in any schema, resulting in a hierarchy like codegen\data\<namespace> and include\<projectname>\<namespace>. If no namespace is defined in the schema or schemas, the generator places the files directly into the codegen\data and include\<projectname> directories.
For more information on the code generation directory structure, see “The Generated Project Directory.”
A Note on Namespace Collisions
Be aware that multiple instances of the same symbol in a namespace, or in XML documents with no namespace, render the document invalid. In this way, the standard prevents namespace collisions.
It is possible and perfectly legal, however, to build WSDLs or XML Schemas that use symbols of the same name in the same namespace, but with different definitions. This practice is not recommended, and HydraExpress does not support it.
NOTE >> Be aware that using symbols of the same name in the same namespace, but with different definitions, will result in namespace collisions and is not supported.