if (!result) {
out.println(WscompileMessages.WSCOMPILE_ERROR(WscompileMessages.WSCOMPILE_COMPILATION_FAILED()));
return false;
}
if (options.genWsdl) {
DatabindingConfig config = new DatabindingConfig();
List<String> externalMetadataFileNames = options.externalMetadataFiles;
boolean disableXmlSecurity = options.disableXmlSecurity;
if (externalMetadataFileNames != null && externalMetadataFileNames.size() > 0) {
config.setMetadataReader(new ExternalMetadataReader(getExternalFiles(externalMetadataFileNames), null, null, true, disableXmlSecurity));
}
String tmpPath = options.destDir.getAbsolutePath() + File.pathSeparator + options.classpath;
ClassLoader classLoader = new URLClassLoader(Options.pathToURLs(tmpPath),
this.getClass().getClassLoader());
Class<?> endpointClass;
try {
endpointClass = classLoader.loadClass(endpoint);
} catch (ClassNotFoundException e) {
throw new BadCommandLineException(WscompileMessages.WSGEN_CLASS_NOT_FOUND(endpoint));
}
BindingID bindingID = options.getBindingID(options.protocol);
if (!options.protocolSet) {
bindingID = BindingID.parse(endpointClass);
}
WebServiceFeatureList wsfeatures = new WebServiceFeatureList(endpointClass);
// RuntimeModeler rtModeler = new RuntimeModeler(endpointClass, options.serviceName, bindingID, wsfeatures.toArray());
// rtModeler.setClassLoader(classLoader);
if (options.portName != null)
config.getMappingInfo().setPortName(options.portName);//rtModeler.setPortName(options.portName);
// AbstractSEIModelImpl rtModel = rtModeler.buildRuntimeModel();
DatabindingFactory fac = DatabindingFactory.newInstance();
config.setEndpointClass(endpointClass);
config.getMappingInfo().setServiceName(options.serviceName);
config.setFeatures(wsfeatures.toArray());
config.setClassLoader(classLoader);
config.getMappingInfo().setBindingID(bindingID);
com.sun.xml.ws.db.DatabindingImpl rt = (com.sun.xml.ws.db.DatabindingImpl) fac.createRuntime(config);
final File[] wsdlFileName = new File[1]; // used to capture the generated WSDL file.
final Map<String, File> schemaFiles = new HashMap<String, File>();