List<String> partsList = new ArrayList<String>();
msgPartsMap.put(qname, partsList);
Message msg = (Message)messageMap.get(qname);
Map partsMap = msg.getParts();
Iterator ite2 = partsMap.values().iterator();
while (ite2.hasNext()) {
Part part = (Part)ite2.next();
QName elementName = part.getElementName();
QName typeName = part.getTypeName();
if (elementName == null && typeName == null) {
Node errNode = ErrNodeLocator.getNode(doc, WSDLConstants.QNAME_MESSAGE, msg.getQName()
.getLocalPart(), part.getName());
schemaWSDLValidator
.addError(errNode,
"The part does not have a type defined. Every part must "
+ "specify a type from some type system. The type can "
+ "be specified using the built in 'element' or 'type' attributes "
+ "or may be specified using an extension attribute.");
isValid = false;
}
if (elementName != null && typeName != null) {
Node errNode = ErrNodeLocator.getNode(doc, WSDLConstants.QNAME_MESSAGE, msg.getQName()
.getLocalPart(), part.getName());
schemaWSDLValidator.addError(errNode,
"The part has both an element and a type defined. Every "
+ "part must only have an element or a type defined.");
isValid = false;
}
if (elementName != null && typeName == null) {
boolean valid = vlidatePartType(elementName.getNamespaceURI(),
elementName.getLocalPart(), true);
if (!valid) {
Node errNode = ErrNodeLocator.getNode(doc, WSDLConstants.QNAME_MESSAGE, msg
.getQName().getLocalPart(), part.getName());
schemaWSDLValidator.addError(errNode, elementName + " refefrence can not find");
isValid = false;
}
}
if (typeName != null && elementName == null) {
boolean valid = vlidatePartType(typeName.getNamespaceURI(), typeName.getLocalPart(),
false);
if (!valid) {
Node errNode = ErrNodeLocator.getNode(doc, WSDLConstants.QNAME_MESSAGE, msg
.getQName().getLocalPart(), part.getName());
schemaWSDLValidator.addError(errNode, "reference can not find");
isValid = false;
}