// Set BusinessService Key
bindingTemplate.setServiceKey(UDDIKeyConvention.getServiceKey(properties, serviceQName.getLocalPart()));
if (serviceUrl != null) {
// Set AccessPoint
AccessPoint accessPoint = new AccessPoint();
accessPoint.setUseType(AccessPointType.END_POINT.toString());
accessPoint.setValue(urlLocalizer.rewrite(serviceUrl));
bindingTemplate.setAccessPoint(accessPoint);
// Set Binding Key
String bindingKey = UDDIKeyConvention.getBindingKey(properties, serviceQName, portName, serviceUrl);
bindingTemplate.setBindingKey(bindingKey);
}
Service service = wsdlDefinition.getService(serviceQName);
if (service != null) {
TModelInstanceDetails tModelInstanceDetails = new TModelInstanceDetails();
Port port = service.getPort(portName);
if (port != null) {
if (serviceUrl == null) {
for (Object element : port.getExtensibilityElements()) {
String location = null;
if (element instanceof SOAPAddress) {
SOAPAddress address = (SOAPAddress) element;
location = address.getLocationURI();
}
else if (element instanceof HTTPAddress) {
HTTPAddress address = (HTTPAddress) element;
location = address.getLocationURI();
}
else if (element instanceof SOAP12Address) {
SOAP12Address address = (SOAP12Address) element;
location = address.getLocationURI();
}
if (location != null ) {
try {
URL locationURI = new URL(location);
AccessPoint accessPoint = new AccessPoint();
accessPoint.setUseType(AccessPointType.END_POINT.toString());
accessPoint.setValue(urlLocalizer.rewrite(locationURI));
bindingTemplate.setAccessPoint(accessPoint);
// Set Binding Key
String bindingKey = UDDIKeyConvention.getBindingKey(properties, serviceQName, portName, locationURI);
bindingTemplate.setBindingKey(bindingKey);
break;