throw new CeltixServiceInitException(e);
}
QName qName = wsdlService.getQName();
String portName = port.getName();
EndpointReferenceType reference = EndpointReferenceUtils.getEndpointReference(url,qName,portName);
AttributedURIType address = new AttributedURIType();
String bindingId = null;
Binding binding = port.getBinding();
if (null != binding) {
List list = binding.getExtensibilityElements();
if (!list.isEmpty()) {
bindingId = ((ExtensibilityElement) list.get(0)).getElementType().getNamespaceURI();
}
}
List<?> list = port.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);
}
ClassLoader previousLoader = null;
try {
//FIXME: This hack is because SAAJImpl uses Thread.currentThread().getContextClassLoader(),
//this classloader is different from current classLoader.