service.getServiceInfos().get(0).addBinding(bindingInfo);
setTransportId(transportId);
WSDLEndpointFactory wsdlEndpointFactory = null;
if (destinationFactory == null) {
try {
destinationFactory = getBus().getExtension(DestinationFactoryManager.class)
.getDestinationFactory(transportId);
} catch (Throwable t) {
try {
Object o = getBus().getExtension(ConduitInitiatorManager.class)
.getConduitInitiator(transportId);
if (o instanceof WSDLEndpointFactory) {
wsdlEndpointFactory = (WSDLEndpointFactory)o;
}
} catch (Throwable th) {
//ignore
}
}
}
if (destinationFactory instanceof WSDLEndpointFactory) {
wsdlEndpointFactory = (WSDLEndpointFactory)destinationFactory;
}
EndpointInfo ei;
if (wsdlEndpointFactory != null) {
ei = wsdlEndpointFactory.createEndpointInfo(service.getServiceInfos().get(0), bindingInfo, null);
ei.setTransportId(transportId);
} else {
ei = new EndpointInfo(service.getServiceInfos().get(0), transportId);
}
int count = 1;
while (service.getEndpointInfo(endpointName) != null) {
endpointName = new QName(endpointName.getNamespaceURI(),
endpointName.getLocalPart() + count);
count++;
}
ei.setName(endpointName);
ei.setAddress(getAddress());
ei.setBinding(bindingInfo);
if (publishedEndpointUrl != null && !"".equals(publishedEndpointUrl)) {
ei.setProperty("publishedEndpointUrl", publishedEndpointUrl);
}
if (wsdlEndpointFactory != null) {
wsdlEndpointFactory.createPortExtensors(ei, service);
}
service.getServiceInfos().get(0).addEndpoint(ei);
return ei;
}