Map<String, String> explicitNamespaceMappings = this.getDataBinding().getDeclaredNamespaceMappings();
if (explicitNamespaceMappings == null) {
explicitNamespaceMappings = Collections.emptyMap();
}
NamespaceMap nsMap = new NamespaceMap();
for (Map.Entry<String, String> mapping : explicitNamespaceMappings.entrySet()) {
nsMap.add(mapping.getValue(), mapping.getKey());
}
if (!explicitNamespaceMappings.containsKey(WSDLConstants.NS_SCHEMA_XSD)) {
nsMap.add(WSDLConstants.NP_SCHEMA_XSD, WSDLConstants.NS_SCHEMA_XSD);
}
if (!explicitNamespaceMappings.containsKey(serviceInfo.getTargetNamespace())) {
nsMap.add(WSDLConstants.CONVENTIONAL_TNS_PREFIX, serviceInfo.getTargetNamespace());
}
schema.setNamespaceContext(nsMap);
serviceInfo.addSchema(schemaInfo);
return schemaInfo;
}