// Get the proper binding using BindingID
String givenBinding = endpoint.getProtocolBinding();
// Get list of all wsdls and schema
SDDocumentSource primaryWsdl = null;
Collection docs = null;
if(endpoint.getWebService().hasWsdlFile()) {
BaseManager mgr;
if(endpoint.getBundleDescriptor().getApplication().isVirtual()) {
mgr = DeploymentServiceUtils.getInstanceManager(DeployableObjectType.WEB);
} else {
mgr = DeploymentServiceUtils.getInstanceManager(DeployableObjectType.APP);
}
String deployedDir =
mgr.getLocation(endpoint.getBundleDescriptor().getApplication().getRegistrationName());
File pkgedWsdl = null;
if(deployedDir != null) {
if(endpoint.getBundleDescriptor().getApplication().isVirtual()) {
pkgedWsdl = new File(deployedDir+File.separator+
endpoint.getWebService().getWsdlFileUri());
} else {
pkgedWsdl = new File(deployedDir+File.separator+
endpoint.getBundleDescriptor().getModuleDescriptor().getArchiveUri().replaceAll("\\.", "_") +
File.separator + endpoint.getWebService().getWsdlFileUri());
}
} else {
pkgedWsdl = new File(endpoint.getWebService().getWsdlFileUrl().getFile());
}
if(pkgedWsdl.exists()) {
//Canonicalize the filename. Since getWsdlsAndSchemas canonicalizes
//the filenames of the metatdata documents, JAXWS might get into have
//trouble detecting common root paths.
//ie C://foo.wsdl and c://schema.wsdl
pkgedWsdl = pkgedWsdl.getCanonicalFile();
primaryWsdl = SDDocumentSource.create(pkgedWsdl.toURL());
docs = wsu.getWsdlsAndSchemas(pkgedWsdl);
if (logger.isLoggable(Level.FINE)) {
logger.log(Level.INFO, "Creating endpoint with packaged WSDL " +
primaryWsdl.getSystemId().toString());
logger.log(Level.FINE, "Metadata documents:");
for (Object source: docs) {
logger.log(Level.FINE, ((SDDocumentSource)source).getSystemId().toString());
}
}