new Object[] {Constants.Q_ELEM_DESCRIPTION, descEl.getQName()},
ErrorReporter.SEVERITY_FATAL_ERROR);
}
//Get a new description in the context of this reader
DescriptionElement desc =
((BaseWSDLFactory)getFactory()).newDescriptionElement(fWsdlContext);
if(wsdlModules == null)
{
//This is the initial WSDL document. No imports or includes yet.
//TODO this might be the place to flag the initial Desc if necessary.
wsdlModules = new HashMap();
}
desc.setDocumentBaseURI(getURI(documentBaseURI));
String targetNamespace =
descEl.getAttributeValue(Constants.ATTR_TARGET_NAMESPACE);
if(targetNamespace != null)
{
desc.setTargetNamespace(getURI(targetNamespace));
}
parseNamespaceDeclarations(descEl, desc);
parseExtensionAttributes(descEl, DescriptionElement.class, desc, desc);
//parse the child elements
XMLElement[] children = descEl.getChildElements();
XMLElement tempEl = null;
QName tempElQN = null;
for(int i=0; i<children.length; i++)
{
tempEl = children[i];
tempElQN = tempEl.getQName();
if (Constants.Q_ELEM_DOCUMENTATION.equals(tempElQN))
{
parseDocumentation(tempEl, desc, desc);
}
else if (Constants.Q_ELEM_IMPORT.equals(tempElQN))
{
if(documentBaseURI != null && !wsdlModules.containsKey(documentBaseURI))
{
wsdlModules.put(documentBaseURI, desc);
}
parseImport(tempEl, desc, wsdlModules);
}
else if (Constants.Q_ELEM_INCLUDE.equals(tempElQN))
{
if(documentBaseURI != null && !wsdlModules.containsKey(documentBaseURI))
{
wsdlModules.put(documentBaseURI, desc);
}
parseInclude(tempEl, desc, wsdlModules);
}
else if (Constants.Q_ELEM_TYPES.equals(tempElQN))
{
parseTypes(tempEl, desc);
}
else if (Constants.Q_ELEM_INTERFACE.equals(tempElQN))
{
parseInterface(tempEl, desc);
}
else if (Constants.Q_ELEM_BINDING.equals(tempElQN))
{
parseBinding(tempEl, desc);
}
else if (Constants.Q_ELEM_SERVICE.equals(tempElQN))
{
parseService(tempEl, desc);
}
else
{
desc.addExtensionElement(
parseExtensionElement(DescriptionElement.class, desc, tempEl, desc) );
}
}
parseSchemaForXMLSchema(desc); //TODO temporary - see comments within the method