}
}
wsdlURL = new URL(wsdlDocumentLocation);
// This is a temporary usage, so use a memory sensitive wrapper
WSDLWrapper wrapper = new WSDL4JWrapper(wsdlURL, true, 2);
if (serviceName != null) {
QName serviceNameNoTrailingSlash = new QName("");
// TODO: why in the world would we have to do this?
if (serviceName.getNamespaceURI().endsWith("/")) {
String ns = serviceName.getNamespaceURI();
serviceNameNoTrailingSlash = new QName(ns.substring(0, ns.length()-1), serviceName.getLocalPart());
}
if ((wrapper.getService(serviceName) == null) && (wrapper.getService(serviceNameNoTrailingSlash) == null)) {
throw new IllegalStateException(
Messages.getMessage("MissingServiceName",
serviceName.toString(),
wsdlDocumentLocation));
}
if (portName != null) {
String[] ports = wrapper.getPorts(serviceName);
// search the other name. TODO: again, why do we have to do this?
if (ports == null) {
ports = wrapper.getPorts(serviceNameNoTrailingSlash);
}
String portLocalName = portName.getLocalPart();
boolean found = false;
if (ports != null) {