} catch (MalformedURLException e1) {
// not a URL, assume it's a local reference
wsdlLocator = new JarWSDLLocator(this.wsdlURI);
}
Definition definition;
WSDLFactory wsdlFactory;
try {
wsdlFactory = WSDLFactory.newInstance();
} catch (WSDLException e) {
throw new DeploymentException("Could not create WSDLFactory", e);
}
WSDLReader wsdlReader = wsdlFactory.newWSDLReader();
wsdlReader.setFeature("javax.wsdl.importDocuments", true);
wsdlReader.setFeature("javax.wsdl.verbose", false);
try {
if (wsdlURL != null) {
definition = wsdlReader.readWSDL(wsdlURL.toString());
} else if (wsdlLocator != null) {
definition = wsdlReader.readWSDL(wsdlLocator);
} else {
throw new DeploymentException("unknown");
}
} catch (WSDLException e) {
throw new DeploymentException("Failed to read wsdl document", e);
} catch (RuntimeException e) {
throw new DeploymentException(e.getMessage(), e);
}
verifyPortComponentList(definition);
Map services = definition.getServices();
if (services.size() == 0) {
// partial wsdl, return as is
if (this.serviceRefType != null && this.serviceRefType.isSetServiceCompletion()) {
LOG.warn("Service completion is not supported with partial wsdl");
}
} else {
// full wsdl
if (this.serviceRefType != null && this.serviceRefType.isSetServiceCompletion()) {
throw new DeploymentException("Full wsdl, but service completion supplied");
}
Service service = null;
if (this.serviceQName != null) {
service = definition.getService(this.serviceQName);
if (service == null) {
throw new DeploymentException(
"No service wsdl for supplied service qname "
+ this.serviceQName);
}