String serviceUnitRootPath) throws DeploymentException {
File[] wsdls = new File(serviceUnitRootPath).listFiles(filter);
if (wsdls == null || wsdls.length == 0) {
throw failure("deploy", "No wsdl found", null);
}
ServiceUnit su = createServiceUnit();
su.setComponent(component);
su.setName(serviceUnitName);
su.setRootPath(serviceUnitRootPath);
for (int i = 0; i < wsdls.length; i++) {
initFromWsdl(su, wsdls[i]);
}
if (su.getEndpoints().size() == 0) {
throw failure("deploy", "Invalid wsdl: no endpoints found", null);
}
return su;
}