else
{
withAttachments = true;
}
String wsiLevel = WSITestToolsProperties.WARN_NON_WSI;
WSIPreferences wsiPreference = null;
String uri = valInfo.getFileURI();
if(attValue != null)
{
String value = (String)attValue;
if(value.equals("IGNORE"))
{
wsiLevel = WSITestToolsProperties.IGNORE_NON_WSI;
}
else if(value.equals("REQUIRE"))
{
wsiLevel = WSITestToolsProperties.STOP_NON_WSI;
}
}
else
{
if(WSITestToolsProperties.getEclipseContext())
{
wsiPreference = WSITestToolsEclipseProperties.checkWSIPreferences(uri);
wsiLevel = wsiPreference.getComplianceLevel();
}
else
{
wsiPreference = WSITestToolsProperties.checkWSIPreferences(uri);
wsiLevel = wsiPreference.getComplianceLevel();
}
}
// If we are ignoring WS-I then don't run the tests.
if(wsiLevel.equals(WSITestToolsProperties.IGNORE_NON_WSI))
{
return;
}
wsiValid = true;
Definition definition = null;
boolean hasAnalyzerConfig = false;
try
{
//WSDLFactory factory = WSDLFactory.newInstance();
ValidationInfoImpl vali = new ValidationInfoImpl(valInfo.getFileURI(), new MessageGenerator(resourcebundle));
vali.setURIResolver((URIResolver)valInfo.getURIResolver());
WSDLReaderImpl reader = new WSDLReaderImpl(new WSDL11ValidationInfoImpl(vali));
WSDLDocument[] docs = reader.readWSDL(uri, domModel);
int numdocs = docs.length;
for(int i = 0; i < numdocs; i++)
{
WSDLDocument tempDoc = docs[i];
if(tempDoc.getDefinition().getDocumentBaseURI().equals(valInfo.getFileURI()))
{
definition = tempDoc.getDefinition();
break;
}
}
}
catch(WSDLException e)
{
throw new ValidateWSDLException(MessageFormat.format(resourcebundle.getString(_EXC_UNABLE_TO_VALIDATE_WSI), new Object[] { uri }));
}
if (definition != null && valInfo != null)
{
String namespace = definition.getTargetNamespace();
// get all the collections we may need to validate
Collection services = definition.getServices().values();
Collection bindings = definition.getBindings().values();
Collection portTypes = definition.getPortTypes().values();
Collection messages = definition.getMessages().values();
WSDLAnalyzer wsdlAnalyzer;
if(withAttachments)
{
WSIPreferences preferences = new WSIPreferences();
preferences.setComplianceLevel(wsiLevel);
preferences.setTADFile(WSITestToolsProperties.AP_ASSERTION_FILE);
wsdlAnalyzer = new WSDLAnalyzer(uri, preferences);
}
else if(withBasic)
{
WSIPreferences preferences = new WSIPreferences();
preferences.setComplianceLevel(wsiLevel);
preferences.setTADFile(WSITestToolsProperties.SSBP_ASSERTION_FILE);
wsdlAnalyzer = new WSDLAnalyzer(uri, preferences);
}
else if(wsiPreference != null)
{
wsdlAnalyzer = new WSDLAnalyzer(uri, wsiPreference);