if (gcfg != null)
{
if (gcfg.packageNamespaceMap != null)
jwsdl.setPackageNamespaceMap(gcfg.packageNamespaceMap);
}
WSDLDefinitions wsdl = jwsdl.generate(endpointClass);
//Create the WSDL Directory
createDir(outDir + "/wsdl");
String wsdlPath = outDir + "/wsdl/" + j2wc.serviceName + ".wsdl";
//Generate the WSDL
Writer fw = IOUtils.getCharsetFileWriter(new File(wsdlPath), Constants.DEFAULT_XML_CHARSET);
new WSDLWriter(wsdl).write(fw, Constants.DEFAULT_XML_CHARSET);
fw.close();
//Generate the Mapping File
if (j2wc.mappingFileNeeded)
{
UnifiedMetaData unifiedMetaData = jwsdl.getUnifiedMetaData();
JavaWsdlMapping mapping = jwsdl.getJavaWsdlMapping();
createWrapperTypes(j2wc, outDir, unifiedMetaData, mapping, endpointClass);
Writer writer = IOUtils.getCharsetFileWriter(new File(outDir + "/" + j2wc.mappingFileName), Constants.DEFAULT_XML_CHARSET);
writer.write(Constants.XML_HEADER);
writer.write(DOMWriter.printNode(DOMUtils.parse(mapping.serialize()), true));
writer.close();
}
//Generate the webservices.xml file
if (j2wc.wsxmlFileNeeded)
{
WebservicesXMLCreator wscr = new WebservicesXMLCreatorImpl();
wscr.setTargetNamespace(j2wc.targetNamespace);
//wscr.setLocation(new File(outDir).toURL());
wscr.setSeiName(j2wc.endpointName);
wscr.setServiceName(j2wc.serviceName);
//Get the portname from wsdl definitions
WSDLService wsdlService = wsdl.getService(j2wc.serviceName);
String portName = wsdlService.getEndpoints()[0].getName().getLocalPart();
//wscr.setPortName(j2wc.serviceName + "Port");
wscr.setPortName(portName);
//wscr.setMappingFileName(j2wc.mappingFileName);
if (j2wc.servletLink != null)