ExtensionRegistry extReg = this.wsdlReader.getExtensionRegistry();
if (extReg == null) {
extReg = wsdlFactory.newPopulatedExtensionRegistry();
}
String transport = (String)env.get(ToolConstants.CFG_TRANSPORT);
Address address = AddressFactory.getInstance().getAddresser(transport);
Map<String, String> ns = address.getNamespaces(env);
for (String key : ns.keySet()) {
wsdlDefinition.addNamespace(key, ns.get(key));
}
WSDLExtensibilityPlugin plugin = getWSDLPlugin(transport, Port.class);
try {
ExtensibilityElement extElement = plugin.createExtension(address.buildAddressArguments(env));
port.addExtensibilityElement(extElement);
} catch (WSDLException wse) {
Message msg = new Message("FAIL_TO_CREATE_SOAP_ADDRESS", LOG);
throw new ToolException(msg, wse);
}