}
private MessagePart parseMessagePart(TWSDLParserContextImpl context, Element e) {
context.push();
context.registerNamespaces(e);
MessagePart part = new MessagePart(forest.locatorTable.getStartLocation(e));
String partName = Util.getRequiredAttribute(e, Constants.ATTR_NAME);
part.setName(partName);
String elementAttr =
XmlUtil.getAttributeOrNull(e, Constants.ATTR_ELEMENT);
String typeAttr = XmlUtil.getAttributeOrNull(e, Constants.ATTR_TYPE);
if (elementAttr != null) {
if (typeAttr != null) {
errReceiver.error(context.getLocation(e), WsdlMessages.PARSING_ONLY_ONE_OF_ELEMENT_OR_TYPE_REQUIRED(partName));
}
part.setDescriptor(context.translateQualifiedName(context.getLocation(e), elementAttr));
part.setDescriptorKind(SchemaKinds.XSD_ELEMENT);
} else if (typeAttr != null) {
part.setDescriptor(context.translateQualifiedName(context.getLocation(e), typeAttr));
part.setDescriptorKind(SchemaKinds.XSD_TYPE);
} else {
// XXX-NOTE - this is wrong; for extensibility purposes,
// any attribute can be specified on a <part> element, so
// we need to put an extensibility hook here
errReceiver.warning(forest.locatorTable.getStartLocation(e), WsdlMessages.PARSING_ELEMENT_OR_TYPE_REQUIRED(partName));