/** * 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(); // WSDL 2.0 spec requires that even the built-in schema should be returned // 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(); processTypes(descElem); // recursively drill down } }
/** * 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(); // WSDL 2.0 spec requires that even the built-in schema should be returned // 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(); processTypes(descElem); // recursively drill down } }
processTypes(descriptionElement);
processTypes(descriptionElement);