} else {
throw new DeploymentException("If endpoint is not set, the WSDL service '" + getService() + "' "
+ "must contain a single port definition");
}
SOAPAddress sa11 = WSDLUtils.getExtension(port, SOAPAddress.class);
SOAP12Address sa12 = WSDLUtils.getExtension(port, SOAP12Address.class);
if (sa11 != null) {
marshaler.setBaseUrl(sa11.getLocationURI());
} else if (sa12 != null) {
marshaler.setBaseUrl(sa12.getLocationURI());
} else {
throw new DeploymentException("No SOAP address defined on port '" + port.getName() + "'");
}
description = WSDLUtils.getWSDL11Factory().newWSDLWriter().getDocument(def);
marshaler.setBinding(BindingFactory.createBinding(port));