try {
traceParams(Project.MSG_VERBOSE);
validate();
// Instantiate the emitter
Emitter emitter = new Emitter();
//do the mappings, packages are the key for this map
mappings.execute(this,namespaceMap, true);
if (!namespaceMap.isEmpty()) {
emitter.setNamespaceMap(namespaceMap);
}
if (servicePortName != null) {
emitter.setServicePortName(servicePortName);
}
if (portTypeName != null) {
emitter.setPortTypeName(portTypeName);
}
if (bindingName != null) {
emitter.setBindingName(bindingName);
}
log("Java2WSDL " + className, Project.MSG_INFO);
emitter.setCls(className);
if (implClass != null) {
emitter.setImplCls(implClass);
}
if (exclude != null) {
emitter.setDisallowedMethods(exclude);
}
if (stopClasses != null) {
emitter.setStopClasses(stopClasses);
}
if (extraClasses != null) {
emitter.setExtraClasses(extraClasses);
}
TypeMappingRegistryImpl tmr = new TypeMappingRegistryImpl();
tmr.doRegisterFromVersion(typeMappingVersion);
emitter.setTypeMappingRegistry(tmr);
// Create TypeMapping and register complex types
TypeMappingDelegate tmi = (TypeMappingDelegate)tmr.getDefaultTypeMapping();
Iterator i = complexTypes.iterator();
while (i.hasNext()) {
((ComplexType) i.next()).register(tmi);
}
if (style != null) {
emitter.setStyle(style);
}
if (use != null) {
emitter.setUse(use);
}
if (importSchema != null) {
emitter.setInputSchema(importSchema);
}
if (input != null) {
emitter.setInputWSDL(input);
}
emitter.setIntfNamespace(namespace);
emitter.setImplNamespace(namespaceImpl);
emitter.setLocationUrl(location);
emitter.setImportUrl(locationImport);
emitter.setUseInheritedMethods(useInheritedMethods);
if(serviceElementName!=null) {
emitter.setServiceElementName(serviceElementName);
}
if(methods!=null) {
emitter.setAllowedMethods(methods);
}
if (soapAction != null) {
emitter.setSoapAction(soapAction);
}
if (outputImpl == null) {
// Normal case
emitter.emit(output, Emitter.MODE_ALL);
} else {
// Emit interface and implementation wsdls
emitter.emit(output, outputImpl);
}
} catch(BuildException b) {
//pass build exceptions up the wire