InputStream in = file.getClassLoader().getResourceAsStream(SERVICEWSDL);
boolean foundservice = false;
try {
if (in != null) {
WOMBuilder builder = WOMBuilderFactory.getBuilder(WOMBuilderFactory.WSDL11);
WSDLVersionWrapper wsdlVersionWrapper = builder.build(in,
new AxisDescWSDLComponentFactory());
WSDLDescription womDescription = wsdlVersionWrapper.getDescription();
Iterator iterator = womDescription.getServices().keySet()
.iterator();
if (iterator.hasNext()) {
foundservice = true;
// remove <wsdl:service> and <wsdl:binding> elements from the service
// description we read in as we will be replacing them anyway.
WSDLServiceImpl serviceimpl = (WSDLServiceImpl) womDescription.getServices().get(iterator.next());
service = new ServiceDescription(serviceimpl);
// service =
// (ServiceDescription) womDescription.getServices()
// .get(iterator.next());
}
if (!foundservice) {
service = new ServiceDescription();
}
service.setWSDLDefinition(wsdlVersionWrapper.getDefinition());
in.close();
} else {
service = new ServiceDescription();
log.info(Messages.getMessage(DeploymentErrorMsgs.WSDL_FILE_NOT_FOUND,
file.getName()));