public EndpointReference createEndpoint(EndpointMetaData metaData, WSDLReference wsdlRef, final ClassLoader classLoader)
throws EndpointManagementException
{
try
{
File wsdlFile=new File(wsdlRef.getWsdlURL().toURI());
// Find deployment root folder
File root=wsdlFile.getParentFile();
while (root != null && !(new File(root,
BPELDeploymentUnit.DEPLOY_XML).exists() ||
new File(root, BPELDeploymentUnit.BPEL_DEPLOY_XML).exists())) {
root = root.getParentFile();
}
if (root == null) {
throw new EndpointManagementException("Failed to locate root folder of BPEL deployment unit");
}
// Check if a handler file has been specified
File handlerFile=new File(root, "jws_handlers.xml");
String handlerFilePath=null;
if (handlerFile.exists()) {
handlerFilePath = "/"+handlerFile.getName();
}
// generate provider impl
WebServiceProviderGenerator providerFactory = new WebServiceProviderGenerator();
BaseWebServiceEndpoint providerImpl =
providerFactory.createProvider(metaData, wsdlRef, classLoader,
handlerFilePath, ODEWebServiceFactory.class);
log.debug("Created dynamic endpoint class " + providerImpl.getClass().getName());
// create deployment structure (maybe replaced by shrinkwrap)
File warArchive = new DeploymentBuilder(serverConfig)
.setEndpoint(metaData.getEndpointId())
.setWSDL(wsdlFile, root)
.setProvider(providerImpl)
.process(new JBossWSCXFBuildProcessor(providerImpl))
.build();