/* */ public void handleWSDLToJavaGeneration(Configuration config, String outDir)
/* */ {
/* 260 */ Configuration.WSDLToJavaConfig w2jc = config.getWSDLToJavaConfig(false);
/* 261 */ Configuration.GlobalConfig glc = config.getGlobalConfig(false);
/* */
/* 263 */ WSDLToJava wsdlToJava = new WSDLToJava();
/* 264 */ wsdlToJava.setTypeMapping(new LiteralTypeMapping());
/* */
/* 266 */ WSDLDefinitions wsdl = null;
/* */ try
/* */ {
/* 269 */ URL wsdlURL = null;
/* */ try
/* */ {
/* 272 */ wsdlURL = new URL(w2jc.wsdlLocation);
/* */ }
/* */ catch (MalformedURLException e)
/* */ {
/* */ }
/* */
/* 279 */ if (wsdlURL == null)
/* */ {
/* 281 */ File wsdlFile = new File(w2jc.wsdlLocation);
/* 282 */ if (wsdlFile.exists())
/* */ {
/* 284 */ wsdlURL = wsdlFile.toURL();
/* */ }
/* */ }
/* */
/* 288 */ if (wsdlURL == null)
/* */ {
/* 290 */ ClassLoader ctxLoader = Thread.currentThread().getContextClassLoader();
/* 291 */ wsdlURL = ctxLoader.getResource(w2jc.wsdlLocation);
/* */ }
/* */
/* 294 */ if (wsdlURL == null) {
/* 295 */ throw new IllegalArgumentException("Cannot load wsdl: " + w2jc.wsdlLocation);
/* */ }
/* 297 */ wsdl = wsdlToJava.convertWSDL2Java(wsdlURL);
/* 298 */ if (glc != null) {
/* 299 */ wsdlToJava.setNamespacePackageMap(glc.packageNamespaceMap);
/* */ }
/* 301 */ wsdlToJava.setParameterStyle(w2jc.parameterStyle);
/* 302 */ wsdlToJava.generateSEI(wsdl, new File(outDir));
/* */
/* 305 */ generateServiceFile(getPackageName(wsdl, glc), wsdl, outDir);
/* */
/* 308 */ if (w2jc.mappingFileNeeded)
/* */ {
/* 310 */ MappingFileGenerator mgf = new MappingFileGenerator(wsdl, new LiteralTypeMapping());
/* 311 */ mgf.setPackageName(getPackageName(wsdl, glc));
/* 312 */ mgf.setServiceName(wsdl.getServices()[0].getName().getLocalPart());
/* 313 */ mgf.setParameterStyle(w2jc.parameterStyle);
/* */
/* 315 */ JavaWsdlMapping jwm = mgf.generate();
/* 316 */ Writer writer = IOUtils.getCharsetFileWriter(new File(outDir + "/" + w2jc.mappingFileName), "UTF-8");
/* 317 */ writer.write("<?xml version='1.0' encoding='UTF-8'?>");
/* 318 */ writer.write(DOMWriter.printNode(DOMUtils.parse(jwm.serialize()), true));
/* 319 */ writer.close();
/* */ }
/* */
/* 323 */ if (w2jc.wsxmlFileNeeded)
/* */ {
/* 325 */ String seiName = "mypackage.MyServiceEndpointInterface";
/* 326 */ String serviceName = "MyServiceName";
/* */
/* 328 */ if (wsdl.getServices().length == 1) {
/* 329 */ serviceName = wsdl.getServices()[0].getName().getLocalPart();
/* */ }
/* 331 */ if (wsdl.getInterfaces().length == 1)
/* */ {
/* 333 */ String seiPackage = getPackageName(wsdl, glc);
/* 334 */ seiName = seiPackage + "." + wsdlToJava.getServiceEndpointInterfaceName(wsdl.getInterfaces()[0]);
/* */ }
/* */
/* 337 */ WebservicesXMLCreator wscr = new WebservicesXMLCreatorImpl();
/* 338 */ wscr.setTargetNamespace(wsdl.getTargetNamespace());
/* 339 */ wscr.setSeiName(seiName);