XSModel[] schemas = valInfo.getSchemas();
int numSchemas = schemas.length;
//Iterator schemasIter = schemas.iterator();
for (int i = 0; i < numSchemas; i++)
{
XSModel schema = schemas[i];
if (schema != null)
{
if (part == ELEMENT && schema.getElementDeclaration(name, namespace) != null)
{
partvalid = true;
break;
}
else if (part == TYPE && schema.getTypeDefinition(name, namespace) != null)
{
partvalid = true;
break;
}
}
}
}
// If the SOAP encoding namespace hasn't been explicitly imported do so
// now.
// Allow the SOAP encoding namespace to be automatically imported but mark
// it as a warning.
if (!partvalid && namespace.equals(SOAP_ENCODING_URI))
{
try
{
XSDValidator xsdVal = new XSDValidator();
String soapEnc = valInfo.getURIResolver().resolve("", SOAP_ENCODING_URI, null).getPhysicalLocation();
if(soapEnc != null)
{
xsdVal.validate(soapEnc, null, valInfo.getSchemaCache());
// sanity check in case something goes wrong
if (xsdVal.isValid())
{
XSModel xsModel = xsdVal.getXSModel();
if (part == ELEMENT && xsModel.getElementDeclaration(name, namespace) != null)
{
partvalid = true;
}
else if (part == TYPE && xsModel.getTypeDefinition(name, namespace) != null)
{
partvalid = true;
}
valInfo.addWarning(messagegenerator.getString(_WARN_SOAPENC_IMPORTED_PART, QUOTE + name + QUOTE), partObject);
}