String xsdJavaPackage, int genOptions)
{
// Initialize the SDO runtime
DataObjectUtil.initRuntime();
EPackage.Registry packageRegistry = new EPackageRegistryImpl(EPackage.Registry.INSTANCE);
ExtendedMetaData extendedMetaData = new BasicExtendedMetaData(packageRegistry);
HelperContext context = new HelperContextImpl(extendedMetaData, false);
XSDHelper xsdHelper = context.getXSDHelper();
try {
// Load the WSDL file
File inputFile = new File(wsdlFileName).getAbsoluteFile();
InputStream inputStream = new FileInputStream(inputFile);
// Define SDO metadata
xsdHelper.define(inputStream, inputFile.toURI().toString());
if (targetDirectory == null) {
targetDirectory = new File(wsdlFileName).getCanonicalFile().getParent();
} else {
targetDirectory = new File(targetDirectory).getCanonicalPath();
}
// Populate the typeMapping table that will be given to the Axis2 WSDL2Java
Map<QName, SDODataBindingTypeMappingEntry> typeMapping =
new HashMap<QName, SDODataBindingTypeMappingEntry>();
if (!packageRegistry.values().isEmpty()) {
ResourceSet resourceSet = DataObjectUtil.createResourceSet();
// Populate list of GenPackages and a map of GenClasses keyed by EClass
List<GenPackage> genPackages = new ArrayList<GenPackage>();
Map<EClass, GenClass> genClasses = new HashMap<EClass, GenClass>();
for (Iterator iter = packageRegistry.values().iterator(); iter.hasNext();) {
EPackage currentEPackage = (EPackage)iter.next();
String currentBasePackage = extractBasePackageName(currentEPackage, xsdJavaPackage);
String currentPrefix = CodeGenUtil.capName(currentEPackage.getName());
GenPackage currentGenPackage = createGenPackage(currentEPackage, currentBasePackage,