|
Lines 1-5
Link Here
|
| 1 |
/******************************************************************************* |
1 |
/******************************************************************************* |
| 2 |
* Copyright (c) 2002-2005 IBM Corporation and others. |
2 |
* Copyright (c) 2002, 2008 IBM Corporation and others. |
| 3 |
* All rights reserved. This program and the accompanying materials |
3 |
* All rights reserved. This program and the accompanying materials |
| 4 |
* are made available under the terms of the Eclipse Public License v1.0 |
4 |
* are made available under the terms of the Eclipse Public License v1.0 |
| 5 |
* which accompanies this distribution, and is available at |
5 |
* which accompanies this distribution, and is available at |
|
Lines 19-31
Link Here
|
| 19 |
|
19 |
|
| 20 |
import javax.wsdl.Definition; |
20 |
import javax.wsdl.Definition; |
| 21 |
import javax.wsdl.Types; |
21 |
import javax.wsdl.Types; |
| 22 |
import javax.wsdl.extensions.UnknownExtensibilityElement; |
22 |
import javax.wsdl.extensions.schema.Schema; |
| 23 |
|
23 |
|
| 24 |
import org.w3c.dom.Element; |
24 |
import org.w3c.dom.Element; |
| 25 |
import org.w3c.dom.NamedNodeMap; |
25 |
import org.w3c.dom.NamedNodeMap; |
| 26 |
import org.w3c.dom.Node; |
26 |
import org.w3c.dom.Node; |
| 27 |
|
27 |
|
| 28 |
import com.ibm.wsdl.Constants; |
28 |
import com.ibm.wsdl.Constants; |
|
|
29 |
import com.ibm.wsdl.extensions.schema.SchemaConstants; |
| 29 |
|
30 |
|
| 30 |
/** |
31 |
/** |
| 31 |
* Plugin validator for the WSDL Validation framework. Validates inline schema found in a WSDL document. |
32 |
* Plugin validator for the WSDL Validation framework. Validates inline schema found in a WSDL document. |
|
Lines 40-46
Link Here
|
| 40 |
public Map validate(Object element, List parents, String filename) throws Exception |
41 |
public Map validate(Object element, List parents, String filename) throws Exception |
| 41 |
{ |
42 |
{ |
| 42 |
elements = new Vector(); |
43 |
elements = new Vector(); |
| 43 |
UnknownExtensibilityElement elem = (UnknownExtensibilityElement) element; |
44 |
Schema elem = (Schema) element; |
| 44 |
Definition wsdlDefinition = (Definition) parents.get(parents.size() - 1); |
45 |
Definition wsdlDefinition = (Definition) parents.get(parents.size() - 1); |
| 45 |
// Add in the namespaces defined in the doc already that aren't defined locally in this schema. |
46 |
// Add in the namespaces defined in the doc already that aren't defined locally in this schema. |
| 46 |
// There is no need to check for namespaces other then in the defintions and types elements as |
47 |
// There is no need to check for namespaces other then in the defintions and types elements as |
|
Lines 63-69
Link Here
|
| 63 |
|
64 |
|
| 64 |
// If the namespace given is one of the old schema namespaces produce a warning. |
65 |
// If the namespace given is one of the old schema namespaces produce a warning. |
| 65 |
String namespace = w3celement.getNamespaceURI(); |
66 |
String namespace = w3celement.getNamespaceURI(); |
| 66 |
if(namespace.equals(Constants.NS_URI_XSD_1999) || namespace.equals(Constants.NS_URI_XSD_2000)) |
67 |
if(namespace.equals(SchemaConstants.NS_URI_XSD_1999) || namespace.equals(SchemaConstants.NS_URI_XSD_2000)) |
| 67 |
{ |
68 |
{ |
| 68 |
throw new Exception("An old version of the schema namespace is specified."); |
69 |
throw new Exception("An old version of the schema namespace is specified."); |
| 69 |
} |
70 |
} |
|
Lines 132-138
Link Here
|
| 132 |
Iterator iSchemas = schemas.iterator(); |
133 |
Iterator iSchemas = schemas.iterator(); |
| 133 |
while (iSchemas.hasNext()) |
134 |
while (iSchemas.hasNext()) |
| 134 |
{ |
135 |
{ |
| 135 |
UnknownExtensibilityElement extElem = (UnknownExtensibilityElement) iSchemas.next(); |
136 |
Schema extElem = (Schema) iSchemas.next(); |
| 136 |
String thisNamespace = extElem.getElement().getAttribute(Constants.ATTR_TARGET_NAMESPACE); |
137 |
String thisNamespace = extElem.getElement().getAttribute(Constants.ATTR_TARGET_NAMESPACE); |
| 137 |
if (thisNamespace != null && !thisNamespace.equalsIgnoreCase(targetNamespace)) |
138 |
if (thisNamespace != null && !thisNamespace.equalsIgnoreCase(targetNamespace)) |
| 138 |
{ |
139 |
{ |