url = new URL(key);
} catch (MalformedURLException e) {
throw new ContextInitException(e);
}
EndpointReferenceType reference = EndpointReferenceUtils.getEndpointReference(url,
wsBinding.getWSDLService().getQName(),
wsBinding.getWSDLPort().getName());
AttributedURIType address = new AttributedURIType();
String bindingId = null;
Binding binding = wsBinding.getWSDLPort().getBinding();
if (null != binding) {
List list = binding.getExtensibilityElements();
if (!list.isEmpty()) {
bindingId = ((ExtensibilityElement)list.get(0)).getElementType().getNamespaceURI();
}
}
List<?> list = wsBinding.getWSDLPort().getExtensibilityElements();
for (Object ep : list) {
ExtensibilityElement ext = (ExtensibilityElement)ep;
if (ext instanceof SOAPAddress) {
if (bindingId == null) {
bindingId = ((SOAPAddress)ext).getLocationURI();
}
address.setValue(((SOAPAddress)ext).getLocationURI());
}
if (ext instanceof AddressType) {
if (bindingId == null) {
bindingId = ((AddressType)ext).getLocation();
}
address.setValue(((AddressType)ext).getLocation());
}
}
if (reference.getAddress() == null) {
//REVIST - bug in Celtix that the HTTP transport won't find the address correctly
reference.setAddress(address);
}
try {
serverBinding = bus.getBindingManager().getBindingFactory(bindingId).createServerBinding(
reference, this);