* @return <code>Result</code> the results for this assertion
*/
public Result check (WebServiceEndpoint descriptor) {
Result result = getInitializedResult();
ComponentNameConstructor compName = getVerifierContext().getComponentNameConstructor();
String[] reqSchemaLocationSub1 =
{"http://java.sun.com/xml/ns/j2ee", "http://java.sun.com/xml/ns/javaee"};
String[] reqSchemaLocationSub2 =
{"http://www.ibm.com/webservices/xsd/j2ee_web_services_1_1.xsd",
"http://java.sun.com/xml/ns/javaee/javaee_web_services_1_2.xsd"};
boolean rslt = false;
String schemaVersion = getVerifierContext().getSchemaVersion();
Document wsdoc=getVerifierContext().getWebServiceDocument();
//with jax-ws it is not mandatory to define webservices.xml deployment descriptor
if (wsdoc == null && schemaVersion.compareTo("1.1") > 0) {
addGoodDetails(result, compName);
result.passed(smh.getLocalString(getClass().getName() + ".passed1",
"Webservices deployment descriptor is not defined for this archive"));
return result;
}
try {
if (wsdoc.getDocumentElement().hasAttributes()) {
getNode(wsdoc);
if ( myValue != null) {
for(i=0; i<reqSchemaLocation.length; i++) {
rslt = verifySchema(myValue, reqSchemaLocation[i],
reqSchemaLocationSub1[i], reqSchemaLocationSub2[i]);
if(rslt) break;
}
}
}
if (rslt) {
result.addGoodDetails(smh.getLocalString ("tests.componentNameConstructor",
"For [ {0} ]", new Object[] {compName.toString()}));
result.passed(smh.getLocalString (getClass().getName() + ".passed",
"The schemaLocation in the webservices.xml file for [{0}] matches the schema file requirement",
new Object[] {compName.toString()}));
}
else {
result.addErrorDetails(smh.getLocalString ("tests.componentNameConstructor",
"For [ {0} ]", new Object[] {compName.toString()}));
result.failed(smh.getLocalString (getClass().getName() + ".failed",
"The schemaLocation in the webservices.xml file for [{0}] does not match the schema file requirement",
new Object[] {compName.toString()}));
}
}catch (Exception e) {
//result.fail
result.failed(smh.getLocalString
(getClass().getName() + ".failed",
"The schemaLocation in the webservices.xml file for [{0}] does not match the schema file requirement",
new Object[] {compName.toString()}));
result.addErrorDetails(smh.getLocalString
("com.sun.enterprise.tools.verifier.tests.webservices.Error",
"Error: Unexpected error occurred [ {0} ]",
new Object[] {e.getMessage()}));
}