{
if (endpointServices.size() > 0)
{
try
{
final JAXWSProviderClassGenerator generator = new JAXWSProviderClassGenerator();
for(WebserviceInfo webserviceInfo: endpointServices)
{
final Service service = webserviceInfo.getService();
// Copy all schemas to the wsdl directory to support imports.
final Map<String, String> schemasMap = JBossDeployerUtil.getSchemas(esbArchive);
final String wsdlDir = "WEB-INF/wsdl/" + service.getCategory().replace('/', '_') + "/";
for (Entry<String, String> schemaEntry : schemasMap.entrySet())
{
webDeployment.addEntry(wsdlDir + schemaEntry.getKey(), schemaEntry.getValue().getBytes());
log.debug("Added schema " + wsdlDir + schemaEntry.getKey());
}
final ESBServiceEndpointInfo serviceInfo = new ESBServiceEndpointInfo(webserviceInfo);
final String wsdl = ESBContractGenerator.generateWSDL(webserviceInfo, serviceInfo, new WebDeploymentClassLoader(localCl, schemasMap));
webDeployment.addEntry(serviceInfo.getWSDLFileName(), wsdl.getBytes("UTF-8"));
final String handlers = JBossDeployerUtil.getHandlers(serviceInfo);
final boolean includeHandlers = (handlers != null);
if (includeHandlers)
{
final String wsHandlerName = "WEB-INF/classes/" + serviceInfo.getPackageName().replace('.', '/') + "/esb-jaxws-handlers.xml";
webDeployment.addEntry(wsHandlerName, handlers.getBytes("UTF-8"));
}
final byte[] wsClass = generator.generate(deploymentName, service.getCategory(),
service.getName(), serviceInfo, includeHandlers);
final String wsClassName = serviceInfo.getClassName().replace('.', '/') + ".class";
webDeployment.addEntry("WEB-INF/classes/" + wsClassName, wsClass);
// Servlet....