use of org.apache.woden.wsdl20.xml.ImportElement in project axis-axis2-java-core by apache.
the class WSDL20ToAxisServiceBuilder method createNamespaceMap.
/**
* recursively drills down to get namespace pairs in nested imported elements
*
* @param descriptionElement - a description element from where import elements
* and types can be found
*/
private void createNamespaceMap(DescriptionElement descriptionElement) {
ImportElement[] importElements = descriptionElement.getImportElements();
for (int i = 0; i < importElements.length; i++) {
DescriptionElement descElem = importElements[i].getDescriptionElement();
NamespaceDeclaration[] namespaceDeclarations = descElem.getDeclaredNamespaces();
for (int j = 0; j < namespaceDeclarations.length; j++) {
NamespaceDeclaration importedNamespaceDeclaration = namespaceDeclarations[j];
if (!stringBasedNamespaceMap.containsKey(importedNamespaceDeclaration.getPrefix())) {
stringBasedNamespaceMap.put(importedNamespaceDeclaration.getPrefix(), importedNamespaceDeclaration.getNamespaceURI().toString());
}
}
// recursively drill down
createNamespaceMap(descElem);
}
}
use of org.apache.woden.wsdl20.xml.ImportElement in project axis-axis2-java-core by apache.
the class WSDL20ToAxisServiceBuilder method processTypes.
/**
* recursively drills down to find all type definitions
* (XSD schemas) in all imported WSDLs and XSDs
*
* @param descriptionElement - a description element from where import elements
* and types can be found
*/
private void processTypes(DescriptionElement descriptionElement) {
TypesElement typesElement = descriptionElement.getTypesElement();
if (typesElement != null) {
Schema[] schemas = typesElement.getSchemas();
for (int i = 0; i < schemas.length; i++) {
XmlSchema schemaDefinition = schemas[i].getSchemaDefinition();
// once asked for schema definitions. But for data binding purposes we can ignore that
if (schemaDefinition != null && !Constants.URI_2001_SCHEMA_XSD.equals(schemaDefinition.getTargetNamespace())) {
axisService.addSchema(schemaDefinition);
}
}
}
ImportElement[] importElements = descriptionElement.getImportElements();
for (int i = 0; i < importElements.length; i++) {
DescriptionElement descElem = importElements[i].getDescriptionElement();
// recursively drill down
processTypes(descElem);
}
}
Aggregations