sysProperties.setSystem();
}
try {
// Instantiate the emitter
Emitter emitter = createEmitter();
//extract the scope
Scope scope = Scope.getScope(deployScope, null);
if (scope != null) {
emitter.setScope(scope);
} else if (deployScope.length() == 0
|| "none".equalsIgnoreCase(deployScope)) {
/* leave default (null, or not-explicit) */;
} else {
log("Unrecognized scope: " + deployScope + ". Ignoring it.", Project.MSG_VERBOSE);
}
//do the mappings, with namespaces mapped as the key
mappings.execute(this, namespaceMap, false);
if (!namespaceMap.isEmpty()) {
emitter.setNamespaceMap(namespaceMap);
}
emitter.setTestCaseWanted(testCase);
emitter.setHelperWanted(helperGen);
if (factory != null) {
emitter.setFactory(factory);
}
emitter.setNamespaceIncludes(nsIncludes);
emitter.setNamespaceExcludes(nsExcludes);
emitter.setProperties(properties);
emitter.setImports(!noImports);
emitter.setAllWanted(all);
emitter.setOutputDir(output);
emitter.setServerSide(server);
emitter.setSkeletonWanted(skeletonDeploy);
emitter.setVerbose(verbose);
emitter.setDebug(debug);
emitter.setQuiet(quiet);
emitter.setTypeMappingVersion(typeMappingVersion);
emitter.setNowrap(noWrapped);
emitter.setAllowInvalidURL(allowInvalidURL);
if (namespaceMappingFile != null) {
emitter.setNStoPkg(namespaceMappingFile.toString());
}
emitter.setTimeout(timeout);
emitter.setImplementationClassName(implementationClassName);
Authenticator.setDefault(new DefaultAuthenticator(username, password));
if (classpath != null) {
AntClassLoader cl = new AntClassLoader(
getClass().getClassLoader(),
getProject(),
classpath,
false);
log("Using CLASSPATH " + cl.getClasspath(),
Project.MSG_VERBOSE);
ClassUtils.setDefaultClassLoader(cl);
}
try {
if(url.indexOf(':') == -1)
url = getProject().resolveFile(url).getAbsolutePath();
} catch (Throwable t){
}
log("WSDL2Java " + url, Project.MSG_INFO);
try {
emitter.run(url);
} catch (Throwable e) {
if (url.startsWith("http://")) {
// What we have is either a network error or invalid XML -
// the latter most likely an HTML error page. This makes
// it impossible to continue with the test, so we stop here